Created by Nils N. Haukås and licenced under Creative Commons CC BY 3.0.
Note the use of xml namespaces. Click down arrow to see translation.
@prefix homeMadeOnt: <http://myBlog.com/homemade-ont/>.
@prefix work: <http://someOntologyBase.org/tech-positions#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
#With N3 triples become oneliners of subject predicate object
<http://someSocialNetwork.com/people#mari> homeMadeOnt:hasJob work:sysadmin.
# Comments are made using the '#' sign
Click up arrow to go back. All the rdf/xml have corresponding N3 translations.
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:knows sns:mina,
sns:ole.
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:knows sns:mina,
sns:ole.
The corresponding n3 remains the same.
Greg Doe
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:knows sns:mina;
foaf:name "Greg Doe".
sns:jane foaf:knows sns:greg;
foaf:name "Jane Doe".
Jane Doe
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix xmlns: <http://www.w3.org/2000/xmlns/>.
@prefix ex: <http://someExampleOntology.org/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg ex:hasPhone "
<a:rawContactXML xmlns:a=\"http://phoneXMLNamespace.org/a#\">
<a:contact celNum=\"123 456 78\">Jane Doe</a:contact>
</a:rawContactXML>
"^^rdf:XMLLiteral.
#The above can be written in one line
sns:greg ex:hasPhone "<a:rawContactXML xmlns:a=\"http://phoneXMLNamespace.org/a#\"> <a:contact celNum=\"123 456 78\">Jane Doe</a:contact> </a:rawContactXML> "^^rdf:XMLLiteral.
Greg Doe
24
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:age 24;
foaf:name "Greg Doe"^^<http://www.w3.org/2001/XMLSchema#string>.
Jane Doe
http://jane.blogg.no/
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:knows sns:john,
_:abc.
_:abc foaf:homepage "http://jane.blogg.no/";
foaf:name "Jane Doe".
http://jane.blogg.no/
John Doe
http://john.blogg.no/
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg foaf:knows _:bnode136700096,
_:bnode800626944.
_:bnode136700096 foaf:homepage "http://john.blogg.no/";
foaf:name "John Doe".
_:bnode800626944 foaf:homepage "http://jane.blogg.no/";
foaf:name "Jane Doe".
John Doe
http://john.blogg.no/
Omitting nodes: Property attributes on an empty property element
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
#Here Greg knows to people who *might* be the same person.
sns:greg foaf:knows _:bnode1421465472,
_:bnode134694720.
_:bnode134694720 foaf:homepage " http://john.blogg.no/";
foaf:name "John Doe".
_:bnode1421465472 foaf:homepage "http://john.blogg.no/";
foaf:name "John Doe".
Greg Doe
Jane Doe
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
sns:greg a foaf:Person;
foaf:name "Greg Doe".
sns:jane a foaf:Person;
foaf:name "Jane Doe".
These abbreviations are possible for rdf:about, rdf:resource, rdf:ID and rdf:datatype.
@prefix sns: <http://someSocialNetwork.com/people#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
<http://newsocialnetwork.com/persons/#Margareth> foaf:knows sns:Greg,
<http://newsocialnetwork.com/persons/Morten>.