RDF의 잘쓰이는 몇가지 포맷에 대한 비교. 용도에 맞게 골라쓰자.
출처: http://www.w3.org/2000/10/swap/doc/formats
English (Very Informal)
There is person, Pat, known as "Pat Smith" and "Patrick Smith".
Pat has a pet dog named "Rover".
English Hypertext (Informal)
Here the ambiguity of terms is addressed by making the words be hypertext links.
The links may or may not work, depending on the servers involved.
Pat is a human with the names "Pat Smith" and "Patrick Smith".
Pat has a pet, a dog, with the name "Rover".
N3
@prefix : <http://www.w3.org/2000/10/swap/test/demo1/about-pat#> . @prefix bio: <http://www.w3.org/2000/10/swap/test/demo1/biology#> . @prefix per: <http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#> . :pat a bio:Human; per:name "Pat Smith", "Patrick Smith"; per:pet [ a bio:Dog; per:name "Rover" ] .
Directed Labeled Graph
RDF/XML
<rdf:RDF xmlns="http://www.w3.org/2000/10/swap/test/demo1/about-pat#" xmlns:bio="http://www.w3.org/2000/10/swap/test/demo1/biology#" xmlns:per="http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <bio:Human rdf:about="#pat"> <per:name>Pat Smith</per:name> <per:name>Patrick Smith</per:name> <per:pet> <bio:Dog> <per:name>Rover</per:name> </bio:Dog> </per:pet> </bio:Human> </rdf:RDF>
N-Triples
With @prefix:
@prefix : <http://www.w3.org/2000/10/swap/test/demo1/about-pat#> . @prefix bio: <http://www.w3.org/2000/10/swap/test/demo1/biology#> . @prefix per: <http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. :pat rdf:type bio:Human. :pat per:name "Pat Smith". :pat per:name "Patrick Smith". :pat per:pat _:genid1. _:genid1 rdf:type bio:Dog. _:genid1 per:name "Rover".
In standard form:
<http://www.w3.org/2000/10/swap/test/demo1/about-pat#pat>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2000/10/swap/test/demo1/biology#Human> . <http://www.w3.org/2000/10/swap/test/demo1/about-pat#pat>
<http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#name> "Pat Smith" . <http://www.w3.org/2000/10/swap/test/demo1/about-pat#pat>
<http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#name> "Patrick Smith" . <http://www.w3.org/2000/10/swap/test/demo1/about-pat#pat>
<http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#pet> _:genid1 . _:genid1
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2000/10/swap/test/demo1/biology#Dog> . _:genid1 <http://www.w3.org/2000/10/swap/test/demo1/friends-vocab#name> "Rover" .