5 ms·
N3 in a nutshell is: ----------------------------------- 1) an object has an id and some types. Both are prepended with a ':' + an object definition ends wi
by lolive 9y ago
N3 in a nutshell is:
-----------------------------------
1) an object has an id and some types. Both are prepended with a ':'
+
an object definition ends with a '.'
For example:
:teacher1 a :Teacher.
2) an object has property values. Each property name is prepended with a ':'. A property value of type string is surrounded with '"""'. A property value of type integer is as-is. Several values for the same property are separated by ','. Properties are separated by ";"
For example:
:teacher1 :firstNames """John""","""Michael""";
:lastName """Doe""".
3) Objects properties are properties whose value is another object. Such an object property value is simply the id of the referenced object.
For example:
:teacher1 :studiedAt :Yale, :Stanford, :Miskatonic.
4) Your object definitions may be split into multiple parts.
For example:
:teacher1 a :Teacher.
:teacher1 :firstNames """John""","""Michael""";
:lastName """Doe""".
:teacher1 :studiedAt :Yale, :Stanford, :Miskatonic.
:Miskatonic a :University.
:Miskatonic :locatedIn :Arkham;
:name """Miskatonic University""".
:Arkham a :City.
:Arkham :famousTeacher :teacher1.
-----------------------------------
Nothing especially difficult, in my humble opinion.
The great benefit of N3 (and the Semantic Web in general) is that the object definitions can come from separate datasets and be merged into a single graph, because all UUIDs are aligned in the Semantic Web.
- lolive 9y agoNote: This is a completely optional feature of N3: N3 can also express rules to apply upon data. For example, add this to the above definition: { ?x :studiedAt ?y } => { ?y a :EducationalInstitution }. and that infers the following object definitions: :Yale a :EducationalInstitution. :Stanford a :EducationalInstitution. :Miskatonic a :EducationalInstitution.
- ape4 9y agoThe triple double quotes are horrible.