Advanced Graph Querying: Difference between revisions

From MemCP
Jump to navigation Jump to search
(Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
(Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
 
Line 5: Line 5:
MemCP exposes its tested SPARQL subset at <code>/rdf/&lt;database&gt;</code>. Queries can combine triple patterns, FILTER expressions, OPTIONAL blocks, bindings, and supported update forms. Turtle data can be loaded through <code>/rdf/&lt;database&gt;/load_ttl</code>.
MemCP exposes its tested SPARQL subset at <code>/rdf/&lt;database&gt;</code>. Queries can combine triple patterns, FILTER expressions, OPTIONAL blocks, bindings, and supported update forms. Turtle data can be loaded through <code>/rdf/&lt;database&gt;/load_ttl</code>.


<syntaxhighlight lang="sparql">
<pre>
SELECT ?person ?name WHERE {
SELECT ?person ?name WHERE {
   ?person <http://xmlns.com/foaf/0.1/name> ?name .
   ?person <http://xmlns.com/foaf/0.1/name> ?name .
Line 11: Line 11:
   FILTER(!BOUND(?active) || ?active = true)
   FILTER(!BOUND(?active) || ?active = true)
}
}
</syntaxhighlight>
</pre>


Update templates include tested DELETE/INSERT/WHERE forms. RDF literals and IRIs must use the supported escaping rules; application input must not be concatenated into query text without validation.
Update templates include tested DELETE/INSERT/WHERE forms. RDF literals and IRIs must use the supported escaping rules; application input must not be concatenated into query text without validation.

Latest revision as of 12:13, 28 August 2026

Advanced Graph Querying

MemCP exposes its tested SPARQL subset at /rdf/<database>. Queries can combine triple patterns, FILTER expressions, OPTIONAL blocks, bindings, and supported update forms. Turtle data can be loaded through /rdf/<database>/load_ttl.

SELECT ?person ?name WHERE {
  ?person <http://xmlns.com/foaf/0.1/name> ?name .
  OPTIONAL { ?person <http://example.org/active> ?active . }
  FILTER(!BOUND(?active) || ?active = true)
}

Update templates include tested DELETE/INSERT/WHERE forms. RDF literals and IRIs must use the supported escaping rules; application input must not be concatenated into query text without validation.

This page documents a tested subset, not complete SPARQL standard conformance or a separate general-purpose graph execution engine. Add successful and must-fail integration tests before advertising another construct. See Introduction to RDF and SQL over REST.

Property-path roadmap

SPARQL property paths remain a planned extension. The intended progression covers one-step alternatives/sequences, inverse paths, optional paths and transitive */+ traversal. Recursive traversal needs explicit visited-set semantics, cancellation, bounds and a physical representation that does not repeatedly materialize the same nodes. Until tests and documentation say otherwise, do not assume property-path syntax is accepted.