Introduction to RDF: Difference between revisions
(Created page with "RDF is the '''Resource Description Format'''. It describes all data in ''Triple Format'': {| class="wikitable" |+ !Subject !Predicate !Object |- |item:1 |a |foaf:Person |- |item:1 |foaf:name |Klaus |- |item:1 |foaf:mbox |klaus@example.com |- |item:1 |foaf:knows |item:2 |- |item:2 |a |foaf:Person |- |item:2 |foaf:name |Dieter |} See also: https://github.com/launix-de/rdfop") |
Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference) |
||
| Line 1: | Line 1: | ||
RDF | <!-- Copyright (C) 2026 Carl-Philip Haensch --> | ||
<!-- SPDX-License-Identifier: GPL-3.0-or-later --> | |||
= 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 <code>knows</code> edge: | |||
{| class="wikitable" | {| class="wikitable" | ||
! Subject !! Predicate !! Object | |||
!Subject | |||
!Predicate | |||
!Object | |||
|- | |- | ||
|item:1 | | <code>item:1</code> || <code>rdf:type</code> || <code>foaf:Person</code> | ||
| | |||
|foaf:Person | |||
|- | |- | ||
|item:1 | | <code>item:1</code> || <code>foaf:name</code> || <code>"Ada"</code> | ||
|foaf:name | |||
| | |||
|- | |- | ||
|item:1 | | <code>item:1</code> || <code>foaf:knows</code> || <code>item:2</code> | ||
| | |||
|foaf:knows | |||
| | |||
|item:2 | |||
|} | |} | ||
See | |||
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 <code>/rdf/<database></code> using HTTP Basic authentication. Load Turtle through <code>/rdf/<database>/load_ttl</code>. Supported behavior includes core triple patterns, selected FILTER expressions and escaping, OPTIONAL left-join behavior, and tested update templates. | |||
<syntaxhighlight lang="bash"> | |||
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 | |||
</syntaxhighlight> | |||
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 [https://github.com/launix-de/rdfop rdfop project] contains a larger RDF browser and templating application built around the same model. | |||
Revision as of 11:59, 28 August 2026
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.
<syntaxhighlight lang="bash"> 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
</syntaxhighlight>
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.