Skip to content

Commit f1aa22e

Browse files
committed
more renamings
1 parent f8b715a commit f1aa22e

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

rdflib_sqlalchemy/sql.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,31 @@ def query_analysis(query, store, connection):
3737
store.queryOptMarks[(_key, table)] = hits + 1
3838

3939

40-
def union_select(selectComponents, distinct=False, select_type=TRIPLE_SELECT):
40+
def union_select(select_components, distinct=False, select_type=TRIPLE_SELECT):
4141
"""
4242
Helper function for building union all select statement.
4343
44-
Terms: u - uri refs v - variables b - bnodes l - literal f - formula
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
4552
46-
Takes a list of:
47-
- table name
48-
- table alias
49-
- table type (literal, type, asserted, quoted)
50-
- where clause string
5153
"""
5254
selects = []
53-
for table, whereClause, tableType in selectComponents:
55+
for table, whereClause, tableType in select_components:
5456

5557
if select_type == COUNT_SELECT:
56-
selectClause = table.count(whereClause)
58+
select_clause = table.count(whereClause)
5759
elif select_type == CONTEXT_SELECT:
58-
selectClause = expression.select([table.c.context], whereClause)
60+
select_clause = expression.select([table.c.context], whereClause)
5961
elif tableType in FULL_TRIPLE_PARTITIONS:
60-
selectClause = table.select(whereClause)
62+
select_clause = table.select(whereClause)
6163
elif tableType == ASSERTED_TYPE_PARTITION:
62-
selectClause = expression.select(
64+
select_clause = expression.select(
6365
[table.c.id.label("id"),
6466
table.c.member.label("subject"),
6567
expression.literal(text_type(RDF.type)).label("predicate"),
@@ -70,14 +72,14 @@ def union_select(selectComponents, distinct=False, select_type=TRIPLE_SELECT):
7072
expression.literal_column("NULL").label("objdatatype")],
7173
whereClause)
7274
elif tableType == ASSERTED_NON_TYPE_PARTITION:
73-
selectClause = expression.select(
75+
select_clause = expression.select(
7476
[c for c in table.columns] +
7577
[expression.literal_column("NULL").label("objlanguage"),
7678
expression.literal_column("NULL").label("objdatatype")],
7779
whereClause,
7880
from_obj=[table])
7981

80-
selects.append(selectClause)
82+
selects.append(select_clause)
8183

8284
order_statement = []
8385
if select_type == TRIPLE_SELECT:

0 commit comments

Comments
 (0)