urn:ietf:rfc:3987
svn://yadiyada.foo.bar/
mailto:antoine.zimmermann@emse.fr
ftp://ftp.liris.fr/#meta
http://en.wikipedia.org/wiki/User:Wikiuser100
http://w3id.org/people/az/me
rdf:
is for http://www.w3.org/1999/02/22-rdf-syntax-ns#
Example:
(http://example.org/data/Laura
, subject
http://social.relations.com/loves
, predicate
http://exmple.org/data/Helmut
) object
ex:Laura rel:loves ex:Helmut
"42"
represents the number fourty two if this is of type decimal integer, but represents sixty six if it is an hexadecimal integerrdf:langString
, there is a language tag which is a BCP 47 tagxsd:
namespace (XML Schema Datatypes) and the rdf:
namespace"lexical form"
^^
datatypeIRI
and when it is an rdf:langString
, "lexical form"
@langTag
"42"
^^
xsd:integer
"THX 1138""
^^
xsd:string
"chat"
@fr
,"chat"
@en
"<p>The <em>beautiful</em> literal!</p>"
^^
rdf:HTML
<http://www.example.com/test#this>
<http://www.example.com/test#this>
<http://relations.example.com/in>
<http://www.example.com/test#box> .
# This is a comment
@prefix ex: <http://www.example.com/test#> . # end dot!
PREFIX rel: <http://relations.example.com/> # alternative notation (no dot!)
ex:this rel:in ex:box . # dot ends statement
ex:this rel:date "2019-09-13"^^xsd:date . # normal literal
ex:this rel:name "this"@en . # language-tagged literal
ex:this rel:code "TX32" . # xsd:string can be omitted
ex:this rel:number 42 . # xsd:integer (no quotes)
ex:this rel:sizeInMeters 3.75 . # xsd:decimal (use a dot)
ex:this rel:isGood true . # xsd:boolean
ex:this rel:isBorring false . # xsd:boolean
[] rel:in ex:box .
_:b1 rel:in ex:box . # a blank node identifier...
ex:me rel:likes _:b1 . # ...allows to reuse the same blank node
ex:box rel:contains ex:this .
ex:box rel:contains ex:that .
# can be written
ex:box rel:contains ex:this, ex:that . # comma
ex:this rel:date "2019-09-13"^^xsd:date;
rel:name "this"@en; # new lines are optional
rel:code "TX32";
rel:nextTo ex:that, ex:thoot, ex:thus .
# assume prefixes are declared
ex:johnDoe rel:worksFor [
a ex:University; # the IRI rdf:type can be replaced by 'a'
rel:name "Berkley";
rel:locatedIn ex:California
] .
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
# other prefixes must be declared
ex:johnDoe rel:worksFor _:bnode .
_:bnode rdf:type ex:University . # 'a' and 'rdf:type' represents the same IRI
_:bnode rel:name "Berkley" .
_:bnode rel:locatedIn ex:California .
@base <http://example.com/base/> . # ends with dot
BASE <http://example.com/base/> # alternative syntax (no dot!)
# prefixes must be declared
<bob> a vocab:Person; # relative IRI
rel:knows <claire> .
BASE <http://example.com/base2#> # base can be redefined
<bob> rel:knows <http://example.com/base/bob> . # different bobs
<http://example.com/base/bob> a vocab:Person;
rel:knows <http://example.com/base/claire> .
<http://example.com/base2#bob>
rel:knows <http://example.com/base/bob> .