There are still some loose ends, but I think
rdflib.sparql.bison.SPARQLEvaluate.py hooks up most of sparql-p.  The
list of straglers are at the bottom:

- Literal datatyping casting and comparison are updated.  XSD casting
functions simply cast to Literal instances using the built-in
introspection.  Literals don't override any operators, so support for
this remains as limited lexical comparison (for everything but
equality comparison)

- Operators fully integrated by compiling FILTER expressions into
sparql-p's anonymous functions with a direct mapping (in some cases)
or additional operators.  So essentially, Python becomes the host
language for implementing SPARQL filter expression operators.  REGEX
support not added yet as this could be optimized by the store

- The DAWG test suite harness is now fully integrated, it dispatches
SPARQL queries against the manifest files, extracts expected results
and compares results

- Initial bindings can now be passed to the SPARQL query (to
facilitate parameterized querying - the above test harness uses this
to extract data about test cases via SPARQL queries against the
manifest file)

- Exceptions for the forms of SPARQL Group Graph Patterns that are
currently not supported:

ExceptionMessages = {
   OPTIONALS_NOT_SUPPORTED                   : 'Nested OPTIONAL not
currently supported',
   GRAPH_PATTERN_NOT_SUPPORTED               : 'Graph Pattern not
currently supported',
   UNION_GRAPH_PATTERN_NOT_SUPPORTED         : 'UNION Graph Pattern
(currently) can only be combined with OPTIONAL Graph Patterns',
   GRAPH_GRAPH_PATTERN_NOT_SUPPORTED         : 'Graph Graph Pattern
(currently) cannot only be used once by themselves or with OPTIONAL
Graph Patterns',
   GROUP_GRAPH_PATTERN_NESTING_NOT_SUPPORTED : 'Nesting of Group
Graph Pattern (currently) not supported',
   CONSTRUCT_NOT_SUPPORTED                   : '"Construct" is not
(currently) supported',
}

- Reordering of Group Graph Patterns to forms that sparql-p supports,
using the following equivalences:

1) { patternA { patternB } } => { patternA. patternB }
2) { basicGraphPatternA OPTIONAL { .. } basicGraphPatternB }
     =>
   { basicGraphPatternA+B OPTIONAL { .. }}


More reordering could be done (perhaps) with other equivalences like
the ones outlined in http://arxiv.org/abs/cs.DB/0605124 :

(1) AND and UNION are associative and commutative.
(2) (P1 AND (P2 UNION P3)) \xAD\xF1 ((P1 AND P2) UNION (P1 AND P3)).
(3) (P1 OPT (P2 UNION P3)) \xAD\xF1 ((P1 OPT P2) UNION (P1 OPT P3)).
(4) ((P1 UNION P2) OPT P3) \xAD\xF1 ((P1 OPT P3) UNION (P2 OPT P3)).
(5) ((P1 UNION P2) FILTER R) \xAD\xF1 ((P1 FILTER R) UNION (P2 FILTER R)).

etc..

Straglers:

- ASK / CONSTRUCT queries
- Solution Modifiers ORDER BY, LIMIT
- stragglers
- SPARQL result formats?: XML/NTriples (for CONSTRUCTs?)/JSON - I know
very little of the latter
- A mechanism for registering extension functions.  All that is needed
is a means to identify modules that define mappings from URIs to
functions (in the environment perhaps) and hook into those maps.  This
could be powerful since the sparql-p expansion tree 'passes' along the
live graph in the bindings that functions work with.
- REGEX function
_______________________________________________
Dev mailing list
[email protected]
http://rdflib.net/mailman/listinfo/dev

Reply via email to