serql.pl
- serql_query(+Query, -Reply, +Module)
- Where Query is either a SeRQL query text or a parsed query.
Reply is, similar to the ODBC interface a term of the form
row(Col1, Col2, ...)
for SELECT statements or a termrdf(S,P,O)
. The predicate is non-deterministic, returning the rows or RDF statements one-by-one. - serql_compile(+Query, -Compiled, +Options)
- Compile a SeRQL query, returning the result in Compiled. Options:
- entailment(Entailment)
- Entailment module to use.
- type(-Type)
- Return one of
select(VarNames)
or construct
- mk_solutions(+Distinct, +Limit, +Offset, -Term)[private]
- Create a solutions-selecting term compatible to SPARQL.
- set_type(+Type, +Options)[private]
- Fill option
type(X)
- serql_run(+Term, -Result)
- select_results(+Spec, -Reply, :Goal)[private]
- Apply ordering and limits on result-set.
- serql_compile_path(+PathExpr, +Type, -PrologGoal)[private]
- Compile a Serql path expression into a plain Prolog goal. Type is one of 'select' or 'construct'.
- statements(+Graph, -ListOfTriples)[private]
- Extract a plain list of triples from an CONSTRUCT
path-expression. Optional parts of the tree are represented as
!
optional(Bool, ListOfTriples)
. Using CONSTRUCT * (i.e. when the executed path is the result path) the goal generated by the compiler will unify Bool with true or false. See also member_statement/2. - where_constraints(+Goal, -Annotations)[private]
- Each annotation is either a plain annotation or a term
or(ListOfAlternatives)
. The latter is used if different paths through the control-structure yields different annotations. - where_constraint_list(+Goal, -Annotations)[private]
- Interpret Goal, making annotations on the variables. Backtracking yields alternative annotations due to choicepoints in Goal.
- join_alt_annots(+ListOfAnnotLists, -AnnotatedVars)[private]
- ListOfAnnotLists is a list of alternative annotations due to choicepoints. Each annotation list represents annotations in the form Var = Annotation. AnnotatedVars is a list of variables with attributes representing their annotations.
- normalise_annotation(+A0, -A)[private]
- Create a normalised version of an annotation for easy processing. Currently only deals with annotations that are a conjunction.
- empty_annotations(+List)[private]
- True if there is no sensible conclusion we can draw using the
annotations found. This is often the case if multiple paths in a
disjunction do not deal with all variables. Note that this is
not necessarily the end of the story. We could rewrite
A,(C1;C2) into (A,C1);(A,C2)
And apply optimisation on both branches.
- smallest_var(+ListOfList, -Smallest)[private]
- Get the smallest (in standard order of terms) annotated variable.
- var_annotations(+Var, +LoL0, -LoL, -Annotations)[private]
- Get all Annotation for Var. Note that the annotation is either the head of the list or not in the list.
- attrs_to_terms(AttrsVars, List)[private]
- Convert X{where=A} into X=A terms. Without this we cannot use bagof/3 and maintain the variables. Not sure this is a bug in bagof or not.
- sort_lol(+ListOfList, ListOfSortedLists)[private]
- remove_annotations(+List, +Attr)[private]
- object_annotations(+In, -Out, -Goal)[private]
- resource_annotations(R, G)[private]
- clean_conj(+Goal0, -Goal)[private]
- Remove redundant true statements from a conjunction
- serql_parse(+Input, -ParseTree)[private]
- Parse the SeRQL statement Input into a Prolog representation.
- ns(?Id, ?URI)[private]
- Translate between namespace id and URI. If the flag rdf_db_namespaces is true, we share the namespace declarations with the SeRQL store.
- namespace_list(-NSList:list)// is det[private]
- uri_codes(-Codes)[private]
- Get a URI string. Does not check for otherwise valid syntax. This could be done using library(url).
- string_codes(-Codes)[private]
- Chars between "...", Can contain \" and \\
- identifier(-Id)[private]
- An SeRQL must start with a letter or an underscore ('_') and can be followed by zero or more letters, numbers, underscores, dashes ('-') or dots ('.').
- serql_keyword(?Keyword)[private]
- True if Keyword is the lowercase version if a keyword
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.