Skip to content

Commit f3758b4

Browse files
committed
Removing some unused constants and cleaning up some documentation
- Adding documentation configuration - Removed some docs that were irrelevant, misleading, or unnecessary as well - Removing unimplemented methods: These are not part of any interface we need to implement, so declaring them is useless
1 parent 6b7c465 commit f3758b4

File tree

6 files changed

+342
-88
lines changed

6 files changed

+342
-88
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ rdflib_sqlalchemy.egg-info
1010
/.eggs/
1111
/dist/
1212
/venv/
13+
docs/api

docs/conf.py

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# rdflib_sqlalchemy documentation build configuration file
4+
#
5+
# This file is execfile()d with the current directory set to its containing dir.
6+
#
7+
# Note that not all possible configuration values are present in this file.
8+
#
9+
# All configuration values have a default; values that are commented out
10+
# serve to show the default.
11+
12+
import sys
13+
import os
14+
from sphinx.ext.apidoc import main as apidoc_main, OPTIONS as apidoc_options
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
sys.path.insert(0, os.path.abspath('../'))
19+
20+
21+
# -- General configuration -----------------------------------------------------
22+
23+
# If your documentation needs a minimal Sphinx version, state it here.
24+
#needs_sphinx = '1.0'
25+
autodoc_default_flags = []
26+
autoclass_content = 'both'
27+
autodoc_member_order = 'bysource'
28+
autodoc_typehints = 'none'
29+
# Add any Sphinx extension module names here, as strings. They can be extensions
30+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
31+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.viewcode',
32+
'sphinx.ext.intersphinx', 'sphinx.ext.napoleon']
33+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
34+
'rdflib': ('https://rdflib.readthedocs.io/en/stable/', None)}
35+
# Add any paths that contain templates here, relative to this directory.
36+
templates_path = ['_templates']
37+
38+
# The suffix of source filenames.
39+
source_suffix = '.rst'
40+
41+
# The encoding of source files.
42+
#source_encoding = 'utf-8-sig'
43+
44+
# The master toctree document.
45+
master_doc = 'index'
46+
47+
# General information about the project.
48+
project = u'RDFLib SQLAlchemy'
49+
copyright = u'2013-2019 RDFLib Team'
50+
51+
# For substitutions in docs
52+
rst_epilog = """
53+
.. |RDF| replace:: :abbr:`RDF (Resource Description Framework)`
54+
..
55+
""" % dict(project=project)
56+
57+
58+
# The version info for the project you're documenting, acts as replacement for
59+
# |version| and |release|, also used in various other places throughout the
60+
# built documents.
61+
#
62+
63+
64+
# The short X.Y version.
65+
try:
66+
import rdflib_sqlalchemy
67+
version = rdflib_sqlalchemy.__version__
68+
# The full version, including alpha/beta/rc tags.
69+
release = rdflib_sqlalchemy.__version__
70+
except Exception:
71+
version = 'dev'
72+
release = 'dev'
73+
74+
# The language for content autogenerated by Sphinx. Refer to documentation
75+
# for a list of supported languages.
76+
#language = None
77+
78+
# There are two options for replacing |today|: either, you set today to some
79+
# non-false value, then it is used:
80+
#today = ''
81+
# Else, today_fmt is used as the format for a strftime call.
82+
#today_fmt = '%B %d, %Y'
83+
84+
# List of patterns, relative to source directory, that match files and
85+
# directories to ignore when looking for source files.
86+
exclude_patterns = ['_build']
87+
88+
# The reST default role (used for this markup: `text`) to use for all documents.
89+
default_role = 'py:obj'
90+
91+
# If true, '()' will be appended to :func: etc. cross-reference text.
92+
#add_function_parentheses = True
93+
94+
# If true, the current module name will be prepended to all description
95+
# unit titles (such as .. function::).
96+
#add_module_names = True
97+
98+
# If true, sectionauthor and moduleauthor directives will be shown in the
99+
# output. They are ignored by default.
100+
#show_authors = False
101+
102+
# The name of the Pygments (syntax highlighting) style to use.
103+
pygments_style = 'sphinx'
104+
105+
todo_include_todos = True
106+
107+
# A list of ignored prefixes for module index sorting.
108+
#modindex_common_prefix = []
109+
110+
# If true, keep warnings as "system message" paragraphs in the built documents.
111+
#keep_warnings = False
112+
113+
114+
# -- Options for HTML output ---------------------------------------------------
115+
116+
# The theme to use for HTML and HTML Help pages. See the documentation for
117+
# a list of builtin themes.
118+
119+
# on_rtd is whether we are on readthedocs.org
120+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
121+
122+
html_theme = 'alabaster'
123+
124+
apidoc_options[:] = ['members', 'no-undoc-members', 'show-inheritance']
125+
apidoc_main('-M -f -e -d 2 -o api ../rdflib_sqlalchemy'.split(' '))
126+
127+
# Theme options are theme-specific and customize the look and feel of a theme
128+
# further. For a list of options available for each theme, see the
129+
# documentation.
130+
html_theme_options = {'show_related': True}
131+
132+
# Add any paths that contain custom themes here, relative to this directory.
133+
#html_theme_path = []
134+
135+
# The name for this set of Sphinx documents. If None, it defaults to
136+
# "<project> v<release> documentation".
137+
#html_title = None
138+
139+
# A shorter title for the navigation bar. Default is the same as html_title.
140+
#html_short_title = None
141+
142+
# The name of an image file (relative to this directory) to place at the top
143+
# of the sidebar.
144+
#html_logo = None
145+
146+
# The name of an image file (within the static path) to use as favicon of the
147+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
148+
# pixels large.
149+
#html_favicon = None
150+
151+
# Add any paths that contain custom static files (such as style sheets) here,
152+
# relative to this directory. They are copied after the builtin static files,
153+
# so a file named "default.css" will overwrite the builtin "default.css".
154+
#html_static_path = ['_static']
155+
156+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
157+
# using the given strftime format.
158+
#html_last_updated_fmt = '%b %d, %Y'
159+
160+
# If true, SmartyPants will be used to convert quotes and dashes to
161+
# typographically correct entities.
162+
#html_use_smartypants = True
163+
164+
# Custom sidebar templates, maps document names to template names.
165+
html_sidebars = {
166+
'**': [
167+
'relations.html', # needs 'show_related': True theme option to display
168+
'searchbox.html',
169+
]
170+
}
171+
172+
# Additional templates that should be rendered to pages, maps page names to
173+
# template names.
174+
#html_additional_pages = {}
175+
176+
# If false, no module index is generated.
177+
#html_domain_indices = True
178+
179+
# If false, no index is generated.
180+
#html_use_index = True
181+
182+
# If true, the index is split into individual pages for each letter.
183+
#html_split_index = False
184+
185+
# If true, links to the reST sources are added to the pages.
186+
#html_show_sourcelink = True
187+
188+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
189+
#html_show_sphinx = True
190+
191+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
192+
#html_show_copyright = True
193+
194+
# If true, an OpenSearch description file will be output, and all pages will
195+
# contain a <link> tag referring to it. The value of this option must be the
196+
# base URL from which the finished HTML is served.
197+
#html_use_opensearch = ''
198+
199+
# This is the file name suffix for HTML files (e.g. ".xhtml").
200+
#html_file_suffix = None
201+
202+
# Output file base name for HTML help builder.
203+
htmlhelp_basename = 'rdflib_sqlalchemy_doc'
204+
205+
206+
# -- Options for LaTeX output --------------------------------------------------
207+
208+
latex_elements = {
209+
# The paper size ('letterpaper' or 'a4paper').
210+
#'papersize': 'letterpaper',
211+
212+
# The font size ('10pt', '11pt' or '12pt').
213+
#'pointsize': '10pt',
214+
215+
# Additional stuff for the LaTeX preamble.
216+
#'preamble': '',
217+
}
218+
219+
# Grouping the document tree into LaTeX files. List of tuples
220+
# (source start file, target name, title, author, documentclass [howto/manual]).
221+
latex_documents = [
222+
('index', 'rdflib_sqlalchemy.tex', u'RDFLib SQLAlchemy Documentation',
223+
u'rdflib_sqlalchemy', 'manual'),
224+
]
225+
226+
# The name of an image file (relative to this directory) to place at the top of
227+
# the title page.
228+
#latex_logo = None
229+
230+
# For "manual" documents, if this is true, then toplevel headings are parts,
231+
# not chapters.
232+
#latex_use_parts = False
233+
234+
# If true, show page references after internal links.
235+
#latex_show_pagerefs = False
236+
237+
# If true, show URL addresses after external links.
238+
#latex_show_urls = False
239+
240+
# Documents to append as an appendix to all manuals.
241+
#latex_appendices = []
242+
243+
# If false, no module index is generated.
244+
#latex_domain_indices = True
245+
246+
247+
# -- Options for manual page output --------------------------------------------
248+
249+
# One entry per manual page. List of tuples
250+
# (source start file, name, description, authors, manual section).
251+
man_pages = [
252+
('index', 'rdflib_sqlalchemy', u'RDFLib SQLAlchemy Documentation',
253+
[u'rdflib_sqlalchemy'], 1)
254+
]
255+
256+
# If true, show URL addresses after external links.
257+
#man_show_urls = False
258+
259+
260+
# -- Options for Texinfo output ------------------------------------------------
261+
262+
# Grouping the document tree into Texinfo files. List of tuples
263+
# (source start file, target name, title, author,
264+
# dir menu entry, description, category)
265+
texinfo_documents = [
266+
('index', 'rdflib_sqlalchemy', u'RDFLib Documentation',
267+
u'rdflib_sqlalchemy', 'rdflib_sqlalchemy', 'RDFLib SQLAlchemy store',
268+
'rdflib_sqlalchemy'),
269+
]
270+
271+
# Documents to append as an appendix to all manuals.
272+
#texinfo_appendices = []
273+
274+
# If false, no module index is generated.
275+
#texinfo_domain_indices = True
276+
277+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
278+
#texinfo_show_urls = 'footnote'
279+
280+
# If true, do not generate a @detailmenu in the "Top" node's menu.
281+
#texinfo_no_detailmenu = False

docs/index.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. rdflib_sqlalchemy documentation master file.
2+
3+
Welcome to the documentation for rdflib-sqlalchemy!
4+
===================================================
5+
6+
Contents:
7+
8+
.. toctree::
9+
:maxdepth: 4
10+
11+
api/modules
12+
13+
14+
Issues
15+
------
16+
See our `issue tracker`_ on Github.com
17+
18+
.. _issue tracker: https://github.com/rdflib/rdflib-sqlalchemy/issues
19+
20+
21+
Indices and tables
22+
==================
23+
24+
* :ref:`genindex`
25+
* :ref:`modindex`
26+
* :ref:`search`
27+

rdflib_sqlalchemy/constants.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,31 @@
33

44

55
COUNT_SELECT = 0
6+
''' Return the count of the number of result tuples '''
7+
68
CONTEXT_SELECT = 1
9+
''' Return the matching contexts '''
10+
711
TRIPLE_SELECT = 2
12+
''' Return the matching triples '''
13+
814
TRIPLE_SELECT_NO_ORDER = 3
15+
''' Return the matching triples in any order '''
916

1017
ASSERTED_NON_TYPE_PARTITION = 3
18+
''' Table of non-type triples '''
19+
1120
ASSERTED_TYPE_PARTITION = 4
21+
''' Table of type triples '''
22+
1223
QUOTED_PARTITION = 5
24+
''' Table of `quoted`_ type triples
25+
26+
.. _quoted: https://rdflib.readthedocs.io/en/stable/univrdfstore.html#terminology
27+
'''
28+
1329
ASSERTED_LITERAL_PARTITION = 6
30+
''' Table of triples with literals '''
1431

1532
FULL_TRIPLE_PARTITIONS = [QUOTED_PARTITION, ASSERTED_LITERAL_PARTITION]
1633

rdflib_sqlalchemy/sql.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ def union_select(select_components, distinct=False, select_type=TRIPLE_SELECT):
4141
"""
4242
Helper function for building union all select statement.
4343
44-
Terms:
45-
u - uri refs
46-
v - variables
47-
b - bnodes
48-
l - literal
49-
f - formula
50-
51-
:param select_components - iterable of (table_name, where_clause_string, table_type) tuples
44+
Args:
45+
select_components (iterable of tuples): Indicates the table and table type
46+
(table_name, where_clause_string, table_type)
47+
distinct (bool): Whether to eliminate duplicate results
48+
select_type (int): From `rdflib_sqlalchemy.constants`. Either `COUNT_SELECT`,
49+
`CONTEXT_SELECT`, `TRIPLE_SELECT`
5250
5351
"""
5452
selects = []

0 commit comments

Comments
 (0)