SPARQL Flashcards
(14 cards)
What are the main RDF syntax formats?
RDF/XML; N-Triples; Turtle; JSON-LD.
What is N-Triples format?
Line-based: each line is a subject predicate object . triple.
Name two Turtle shortcuts.
Reuse subjects with semicolons; comma-separated object lists.
What does JSON-LD provide?
Represents RDF graphs as JSON objects for JSON integration.
How do you declare a prefix in Turtle/SPARQL?
Use @prefix prefix: <namespaceIRI> .</namespaceIRI>
What is the basic structure of a SPARQL SELECT query?
SELECT ?vars WHERE { triple patterns }
What is a triple pattern in SPARQL?
A pattern with subject, predicate, object (variables or terms) to match triples.
What is a SPARQL binding?
A mapping of query variables to RDF terms for each match.
How do you match multiple variables in SPARQL?
Include multiple patterns in WHERE; project each variable in SELECT.
What is variable chaining in SPARQL queries?
Link patterns via shared variables to traverse relationships.
What is the FILTER clause used for?
Restricts solutions by a boolean expression or regex.
What does the UNION clause do?
Performs logical OR between pattern groups.
What is the OPTIONAL clause used for?
Attempts a pattern; if absent, returns NULL for its variables.
How do you query a SPARQL endpoint?
Load the graph into a SPARQL server and run SELECT queries.