An RDF statement is a record of utterance, made following the form, specified by the RDF standard, where at least the subject and the predicate are URI. Read more about RDF statements here. For the statement "David lectures The Algorithms Course in 2017-18", you would need identifiers for "David", "lecture" and the "Algorithms Course". You may identify for an exercise David as ex:David
but for real implementation, this should be avoided as "David" is just one of many properties describing the resource. Also, mnemonic URIs, while easier for people to work with, are not desirable when aiming persistence of the URIs. For example, having an URI to identify an organisation, using the acronym of the organisation in English, should be avoided as the acronym may change while other statements remain valid. Having this in mind, let's say we have ex:s1
, ex:p11
, and ex:o1
to identify the first three parts of the statement. Then we have to make a few RDF statements to make the desired one formally and following a good practice.
ex:s1
ex:p11 ex:o1 ;
foaf:firstName "David" ;
ex:o1 rdfs:label "The Algorithms Course" .
ex:p1 rdfs:label "lectures" .
With this, we have said that David lectures this particular thing. The property ex:p11
would often come from an ontology, where there will be more statements about it, for example, that it is an object property, that it is a certain type of activity and so on. As machines wouldn't know what kind of thing is ex:o1
, it would also need as a class course, and a type of a course or an individual (often referred to as "instance" but wrongly in my opinion) of that type.
Then for this particular course, we need to say that:
ex:o1
ex:hasPeriodEnd "2018"^^xsd:gYear ;
ex:hasPeriodStart "2017"^^xsd:gYear .
Alternatively, we can reify the statement ex:s1 ex:p11 ex:o1
(in other words to make another statement about this statement):
[
rdf:type rdf:Statement ;
ex:hasPeriodEnd "2018"^^xsd:gYear ;
ex:hasPeriodStart "2017"^^xsd:gYear ;
rdf:object ex:o1 ;
rdf:predicate ex:p11 ;
rdf:subject ex:s1 ;
].
There are other ways to make this second statement, depending on the intention and context. For example:
ex:o1
a ex:course1;
ex:hasPeriodEnd "2018"^^xsd:gYear ;
ex:hasPeriodStart "2017"^^xsd:gYear .
ex:course1
rdfs:subClassOf ex:course;
rdfs:label "The Algorithms Course".
ex:course rdfs:label "Course".
And here's the specification of the prefixes used:
@prefix ex: <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>