RDF is a framework for representing information in the form of statements - our fact claims
.
Each statement consists of three components - subject
,tag,
and object
.
We use URLs to uniquely identify resources and the relationships between them.
It becomes easier to read if we work on an example:
<https://fact.claims/> a fact:Claim .
https://fact.claims/
is a
kind of fact:Claim
.<https://fact.claims/>
a
(short for "is a kind of")fact:Claim
- something called a Claim
is defined in the fact:
vocabulary)We can tag our subject with both links and literals, like this:
<https://fact.claims/>
a schema:Organization, prov:Organization, fact:Claim ;
rdf:label "fact.claims";
schema:name "fact.claims" ;
skos:prefLabel "fact.claims";
rdf:comment "The fact.claims project builds tools for fact-based AI.";
owl:sameAs <https://www.fact.claims/>.
<https://fact.claims/>
a
schema:Organization
and a prov:Organization
.rdf:label
, schema:name
, and skos:prefLabel
are well-known properties.rdf:comment
provides a longer description of the subject.owl:sameAs
indicating that it is an alias of another resource.The simplest vocabulary is really just a URL prefix that ensure terms are globally unique.
A short tag uses a prefix (we use fact:
) to stand-in for the URL namespace.
In our example, fact:
is expanded into a full URL when the RDF is parsed only if we declare it as prefix.
@prefix fact: <https://fact.claims/v0/fact#> .
For our implementation, we created and hosted an RDF resource named /v0/fact that describes our terms.
So fact:Claim
becomes <https://fact.claims/v0/fact#Claim>
, a fully qualified URL that can, but need not, be resolvable.
For production use cases, it's best practice to define a formal vocabulary using RDFS notation (W3C standard).
Our vocabulary is retrievable from https://fact.claims/v0/fact and our claims from https://fact.claims/fact.claims.
This allows any agent to make sense of our (or your) terms by following links to their definitions.