Learn RDF and SPARQL¶
Triplestar stores an RDF graph and uses SPARQL both to read it and to insert or update data. You do not need the whole semantic-web stack before starting.
Recommended path¶
- Read the RDF 1.2 Primer for resources, IRIs, literals, triples, and graphs.
- Work through the Apache Jena SPARQL tutorial
for hands-on
SELECT, graph patterns, filters, optional data, and named graphs. Its examples apply to Triplestar even though the runtime is not Jena. - Use the SPARQL 1.1 Query Language as the precise reference when syntax or behavior is unclear.
- Read SPARQL 1.1 Update when writing
INSERT,DELETE, or combined updates for insertion templates.
What to learn first¶
For querying Triplestar, focus on:
PREFIXdeclarations and IRIs;- triple patterns and variables;
SELECT,ASK, andCONSTRUCT;FILTER,OPTIONAL, andBIND;- property paths and aggregates such as
COUNT; - typed literals and named graphs.
For insertion templates, add:
INSERT DATAfor adding concrete triples;DELETE/INSERT ... WHEREfor replacing matched state;- valid RDF terms, especially the difference between an IRI and a literal.
Triplestar-specific extensions¶
After the standard syntax, learn the project-specific pieces:
- the
rdfJinja2 filter converts ROS fields into typed RDF literals; qt:contains functions evaluated when the query runs: configured query-time topic functions expose their latest ROS values, while the built-inqt:tfPosition(frame, referenceFrame)function exposes fresh TF frame positions;fn:functions call Python functions registered by a bringup package;- optional OWL 2 RL reasoning can add inferred triples before a query.
These extensions compose with normal SPARQL. Keeping the graph model and most queries standards-based makes them easier to test outside the robot stack.