Introduction to RDF

From MemCP
Revision as of 12:13, 28 August 2026 by Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction to RDF

RDF represents facts as subject–predicate–object triples. MemCP stores and queries triples through its RDF module and exposes a tested SPARQL subset over HTTP.

Unlike a fixed relational row, a resource can gain another predicate without altering a table schema. IRIs identify resources and predicates; objects may be another resource or a literal. For example, one person can have a type, name, mailbox, and knows edge:

Subject Predicate Object
item:1 rdf:type foaf:Person
item:1 foaf:name "Ada"
item:1 foaf:knows item:2

SPARQL graph patterns join triples by shared variables. RDF is useful for heterogeneous metadata, semantic relationships, knowledge graphs, or integrations that already exchange Turtle/RDF. A conventional SQL schema is often simpler for stable, strongly constrained business records.

Submit a query to /rdf/<database> using HTTP Basic authentication. Load Turtle through /rdf/<database>/load_ttl. Supported behavior includes core triple patterns, selected FILTER expressions and escaping, OPTIONAL left-join behavior, and tested update templates.

curl --fail-with-body -u root:strong-password \
  --data-binary 'SELECT ?s ?p ?o WHERE { ?s ?p ?o . } LIMIT 20' \
  http://localhost:4321/rdf/mygraph

Do not infer support for an unlisted SPARQL feature from the standard. Validate application queries and malformed-input behavior against the deployed version. See Advanced Graph Querying and Security and Authentication.

The external rdfop project contains a larger RDF browser and templating application built around the same model.