W3C home > Mailing lists > Public > www-archive@w3.org > April 2003

Tutorial for Budapest

From: Karl Dubost <karl@w3.org>
Date: Wed, 23 Apr 2003 19:08:32 -0400
Message-Id: <a05200f02bacc8ebd51ce@[10.0.1.3]>
To: www-archive@w3.org
Cc: timbl@w3.org, danc@w3.org

Comments about http://www.w3.org/2000/10/swap/doc/

* Intro:

I'm really happy to see this kind of document and nicely presented. 
These are  few comments related to this work. Comments are [KD: 
text_of_comments]. Sometimes on many lines.

I don't know if my comments are helpful. It was a collection of 
thoughts when I have read the document as a simple reader.


[KD: There is no small introduction to the notion of triples : (a, b, 
c). And why a triple can describe information. I'm making this 
comment, because the next document is going directly in the notion of 
triples.]


============

>* Primer: Getting into RDF & Semantic Web using N3
>http://www.w3.org/2000/10/swap/Primer.html
>
>The world of the semantic web, as based on RDF, is really simple at 
>the base. This article shows you how to get started. It uses a 
>simplified teaching language -- Notation 3 or N3 -- which is 
>basically equivalent to RDF in its XML syntax, but easier to 
>scribble when getting started.
>Subject, verb and object

[KD: I would encourage to have a more progressive way of going. The 
title is called "Going into RDF..." and in the first sentence of the 
document you talked about RDF. Maybe a way is to progressively 
demonstrate n3 to finally reach RDF.]

>In RDF, information is simply a collection of statements, each with 
>a subject, verb and object - and nothing else. In N3, you can write 
>an RDF triple just like that, with a period:

[KD: What are a subject, a verb and a object?
Maybe a very simple example, as you are giving it just after but 
without any mathematical or computing representation like:

	 Pat   knows   Jo.
	`---' `-----' `---'
           S      V      O
]

>In N3, you can write a triple just like that, with a period:
>
>	<#pat> <#knows> <#jo> .
>
>Everything, be it subject, verb, or object, is identified with a 
>Universal Resource Identifier. This is something like 
><http://www.w3.org/> or 
><http://www.w3.org/2000/10/swap/test/s1.n3#includes>, but when 
>everything is missed out before the "#" it identifies <#pat> in the 
>current document whatever it is.


[KD: Everything, be it subject, verb, or object, is identified with a 
Universal Resource Identifier (URI). So it could be written   like:
	<http://www.w3.org/>
or  in the case of an URI-reference, like:
	<http://www.w3.org/2000/10/swap/test/s1.n3#includes>,

but when everything is missed out before the "#" (so when you only 
have the fragment identifier), it identifies <#pat> in the current 
document whatever it is.]

>There is one exception: the object (only) can be a literal, such as 
>a string or integer:
>
><#pat> <#knows> <#jo> .
><#pat> <#age> "24" .

[KD:	Does it mean that the verb is always in 3rd position?
	If not, how do I identify, what are the subject, verb and the object?]

>The verb "knows" is in RDF called a "property" and thought of as a 
>noun expressing a relation between the two. In fact you can write
>
><#pat> <#child> <#al> .
>
>alternatively, to make it more readable, as either
>
><#pat> has <#child> <#al> .
>
>or
>
><#al> is <#child> of <#pat> .

[KD: Ref001
	For the clarity, is it a normative way to write?  "has", 
"is", "of" are  normative or can we create other words, like:

<#pat> <#numbercat> "3" .

<#pat> has <#numbercat> "3" .
<#pat> got <#numbercat> "3" .
<#pat> a <#numbercat> "3" . (french)
<#pat> habe <#numbercat> "3" . (german)

"3" is <#numbercat"> of <#pat> .
"3" est le <#numbercat"> de <#pat> .
]

>There are two shortcuts for when you have several statements about 
>the same subject: a semicolon ";" introduces another property of the 
>same subject, and a comma introduces another object with the same 
>predicate and subject.

[KD: This part is too fast :))) And it's the first you introduce the 
word "predicate" without explaining it before.

There are two shortcuts, when you have several statements about the 
same subject.

	1. A semicolon ";"

The semicolon gives you the possibility to introduce another property 
of the same subject.

Ex:
	<#pat> <#child>  <#al>;
	<#age>    "24" ;
	<#eyecolor> "blue" .

Which means "pat has a child named al, pat is 24 years old and pat 
has blue eyes."

	2. a comma ","

The comma gives you the possibility to introduce another object with 
the same predicate (verb) and subject.

Ex:
	<#pat> <#child>  <#al>, <#chaz>, <#mo> .

which means  "pat has children named al, chaz and mo."

You can combine these two shortcuts together:

Ex:

	<#pat> <#child>  <#al>, <#chaz>, <#mo> ;
	<#age>    "24" ;
	<#eyecolor> "blue" .

]

><#pat> <#child>  <#al>, <#chaz>, <#mo> ;
>        <#age>    "24" ;
>        <#eyecolor> "blue" .
>
>So, for example, the data in the table
>age eyecolor
>pat 24 blue
>al 3 green
>jo 5 green
>
>could be written
>
>   <#pat>   <#age> "24";  <#eyecolor> "blue" .
>   <#al>    <#age>  "3";  <#eyecolor> "green" .
>   <#jo>    <#age>  "5";  <#eyecolor> "green" .
>
>Sometimes there are things involved in a statement don't actually 
>have any identifier you want to give them - you know one exists but 
>you only want to give the properties . You represent this by square 
>brackets with the properties inside.

[KD: An extra space after properties to remove.]

[KD: "don't have any identifier", do you talk about Uniform Resource 
Identifier? Do you talk about subject. So maybe "... don't actually 
have any subject..." would be better.]

><#pat> <#child> [ <#age> "4" ] , [ <#age> "3" ].
>
>You could read this as #pat has a #child which has #age of "4" and a 
>#child which has an #age of "3". There are two important things to 
>remember
>
>     * The identifiers are just identifiers - the fact that the 
>letters p a t are used doesn't tell anyone or any machine that we 
>are talking about anyone whose name is "Pat" -- unless we say <#pat> 
><#name> "Pat". The same applies to the verbs - never take the actual 
>letters c h i l d as telling you what it means - we will find out 
>how to do that later.

[KD: You said "the same applies to verbs", but the previous sentence 
doesn't say that you were talking about subjects nor objects. Maybe 
be better to clarify.]

>     * The square brackets declare that something exists with the 
>given properties, but don't give you a way to refer to it elsewhere 
>in this or another document.
>
>If we actually want to use a name, we could have written the table above as
>
>   [ <#name> "Pat"; <#age> "24";  <#eyecolor> "blue"  ].
>   [ <#name> "Al" ; <#age>  "3";  <#eyecolor> "green" ].
>   [ <#name> "Jo" ; <#age>  "5";  <#eyecolor> "green" ].
>
>There are many ways of combining square brackets - but you can 
>figure that out from the examples later on. There is not much left 
>learn about using N3 to express data, so let us move on.
>
>
>Sharing concepts
>
>The semantic web can't define in one document what something means. 
>That's something you can do in English (or occasionally in math) but 
>when we really communicate using the concept "title", (such in a 
>library of congress catalog card or a web page), we rely on a shared 
>concept of "title". On the semantic web, we share quite precisely by 
>using exactly the same URI for the concept of title.

[KD: Just a thought... it makes an interesting challenge when it 
comes to describe "shared concepts". A concept may exist in one 
culture and not in another one, how do we design system that will 
take into account this kind of things. Sometimes you don't have 
equivalent or you don't have one to one relationship, but more a 
fuzziness of concepts. Do we need guidelines for that?]

>I could try to give the title of an N3 document by
>
><> <#title>  "A simple example of N3".
>
>[KD: Is there a need of a space between the "dot" and the value. 
>Because at the beginning you have always written with a space.]
>
>(The <> being an empty URI reference always refers to the document 
>it is written in.)

[KD: Don't start the paragraph with parenthesis and if it's really 
important, do not put it in parenthesis. I think it is important. :) 
It's a new concept which is introduced now. It gives also very 
interesting things on an implementation issue when it comes to the 
HTTP side.]

>The <#title> refers to the concept of #title as defined by the 
>document itself. This won't mean much to the reader. However, a 
>group of people created a list of properties called the Dublin Core, 
>among which is their idea of title, which they gave the identifier
>
><http://purl.org/dc/elements/1.1/title>. So we can make a much 
>better defined statement if we say
>
><> <http://purl.org/dc/elements/1.1/title>
>  "Primer - Getting into the Semantic Web and RDF using N3".
>
>That of course would be a bit verbose - imagine using such long 
>identifiers for everything like #age and #eyecolor above. So N3 
>allows you to set up a shorthand prefix for the long part - the part 
>we call the namespace. You set it up using "@prefix" like this:
>
>@prefix dc:  <http://purl.org/dc/elements/1.1/> .
><> dc:title
>   "Primer - Getting into the Semantic Web and RDF using N3".
>
>Note that when you use a prefix, you use a colon instead of a hash 
>between dc and title, and you don't use the <angle brackets> around 
>the whole thing. This is much quicker. This is how you will see and 
>write almost all your predicates in N3. Once set up, a prefix can be 
>used for the rest of the file.

[KD: As commented, before does it mean that I have the right to write:

<> has dc:title "Primer - Getting into the Semantic Web and RDF using N3" . ]

>There are an increasingly large number of RDF vocabularies for you 
>to refer to - check the RDF home page and things linked from it - 
>and you can build your own for your own applications very simply.

[KD:	Is it possible to link to a more specific part of the home 
page to reach directly an example list of vocabularies?
	It could be good to define what's an RDF vocabulary. You 
haven't made the relation in the explanation between vocabulary and 
for example "the list of properties". Something like a list of 
properties can be defined by an RDF vocabulary like the one defined 
by Dublin Core.]

>From now, on we are going to use some well known namespaces, and so 
>to save space, I will just assume the prefixes
>
>@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
>@prefix owl:  <http://www.w3.org/2002/07/owl#> .
>
>These are the RDF, RDF schema, and OWL namespaces, respectively. 
>They give us the core terms which we can bootstrap ourselves into 
>the semantic web. I am also going to assume that the empty prefix 
>stands for the document we are writing, which we can say in N3 as

[KD: Define acronyms, for example, <acronym title="Ontology Web 
Language">OWL</acronym>]

>@prefix : <#> .
>
>This means we could have the example above as
>
>:pat :child [ :age "4" ] , [ :age "3" ].
>
>which is slightly less characters to type. Now you understand how to 
>write data in N3, you can start making up your own vocabularies, 
>because they are just data themselves.
>
>
>Making vocabularies
>
>Things like dc:title above are RDF Properties. When you want to 
>define a new vocabulary you define new classes of things and new 
>properties. When you say what type of thing something is, you say a 
>Class it belongs to.

[KD: You have used the <dfn></dfn> tags but not systematically in the 
document, could be nice to do it each time it's required.]

>The property which tells you what type something is is rdf:type 
>which can be abbreviated to N3 to just a. So we can define a class 
>of person

[KD: Maybe better to say, rdf:type is the property which defines the 
type of something. This can be abbreviated to N3 to just a.]

>:Person a rdfs:Class.

[KD: Maybe explain it, because if I read the beginning of your 
document, I can read your expression as:

:Person has a rdfs:Class
or
:Person has rdf:type rdfs:Class
or
rdfs:Class is rdf:type of :Person

So in verbose english, We have defined a property Person (subject) 
which has for type (verb) Class (object).
I hope I got it right, but it was not obvious for me, by just reading it.

	You also do not explain how do I explain to someone else who 
is not familiar with my vocabulary, the meaning of the defined 
classes.
	Can I put comment in the document?
	How do I write these comments?
	Must I have a separate document?
	Must it be in the same document?
	Can I define multilingual versions of my properties? etc.
	It becomes very important when you want to communicate your document.

ok all of that is explained later, maybe a reference now could be good too. :)
http://www.w3.org/2000/10/swap/doc/ontologies
]

>In the same document, we could introduce an actual person
>
>:Pat a :Person.
>
>Classes just tell you about the thing which is in them. An object 
>can be in many classes. There doesn't have to be any hierarchical 
>relationship -- think of Person, AnimateObject, Animal, TallPerson, 
>Friend, and so on. If there is a relationship between two classes 
>you can state it - check out the properties (of classes) in the RDF 
>Schema and OWL vocabularies.
>
>:Woman a rdfs:Class; rdfs:subClassOf :Person .

[KD: So

	rdfs:Class is rdf:type of :Woman
AND
	:Person is rdfs:subClassOf of :Woman

Is it correct? I would have said the opposite for the second one.

Person
	---> Woman
		---> Pat
	---> Man
		---> ...

but maybe I haven't understood the concept of Person here.]

>A property is something which is used to declare a relationship 
>between two things.
>
>:sister a rdf:Property.

[KD: hmmm not sure but it seems you have introduced the way you write 
it into N3 before explaining the concepts.

"A property is something which is used to declare a relationship 
between two things."

I do not understand this sentence, because I have to assume many 
things to understand it. What does "relationship" mean in this 
context. You have "something", "things" and "relationship", could you 
make it clearer?

	:sister has rdf:type rdf:Property

What does it mean on the use of sister? how can I use it? just  like that?

	:pat :sister :amanda .

So amanda is the sister of pat, but why in this case we didn't define 
sister has a class?

:familyRelationship a rdfs:Class; rdfs:subClassOf :sister .

or both are compatible?
]

>Sometimes when a relationship exists between two things, you 
>immediately know something about them, which you can express as a 
>class.

[KD: How do I do that? an example?]

>When the subject of any property must be in a class, that class is a 
>domain of the property.

[KD: Could you give an example in plain english.]

>When the object must be in a class, that class is called the range 
>of a property.

[KD: example in plain english, please]

>A property can have many domains and ranges, but typically one specifies one.

[KD: The whole paragraph is too complicated again. Make it clearer. 
Each time, you define something, create a plain english example. 
Illustrate. Right now, I'm not able to understand what you really 
meant.]

>:sister rdfs:domain :Person;
>         rdfs:range :Woman.

[KD: This example is not self explaining. It will be helpful for the 
reader to each time illustrate the differences between domain, range, 
class, type  and subclassof.]

>Note the class identifiers start with capitals and properties with 
>lower case letters. This is not a rule, but it is a good convention 
>to stick to. Note also that because the domain of rdfs:range and 
>rdfs:domain themselves is rdf:Property, it follows that :sister is a 
>rdf:Property without it being stated explicitly.

[KD: "This is not a rule" -> "This is not a MUST rule" or "This is 
not mandatory".]


>Equivalence
>
>Often, you define a vocabulary where one or more of the terms, 
>whether or not you realized it when you started, is in fact exactly 
>the same as one in another vocabulary. This is a really useful 
>titbit of information for any machine or person dealing with the 
>information! The property of equivalence between two terms is so 
>useful and fundamental that N3 has a special shorthand for it, "=".

[KD: Maybe you should rewrite it like (with my faulty english :/) :

>Often, you define a vocabulary with one or more terms which may 
>already be defined elsewhere on the Web. It may happen that you 
>didn't know about this other vocabulary when you created your 
>definition, but when you realize that it exists, the fact that both 
>your vocabulary and this existing vocabulary are equivalent is very 
>useful information for any machine or person!
>
>The property of equivalence between two terms is so useful and 
>fundamental that N3 has a special shorthand for it, "=".]
>
>:Woman = foo:FemaleAdult .
>:Title a rdf:Property; = dc:title .

[KD: Which means that in your document you have defined at the top

@prefix foo:  <http://example.org/vocabulary/> .
]

>Tip: Use other people's vocabularies when you can - it helps 
>interchange of data. When you define your own vocabulary which 
>includes synonyms, do record the equivalence because this, likewise, 
>will help present and future processors process your and others' 
>data in meaningful ways.

[KD:	How to you deal with vocabularies which disappear on the Web?
	How do I choose to make my own to be sure that the other ones 
do not disappear?
	Is there a possibility of making a list of all places where 
the same vocabulary is on the web? (having a list of URIs more than 
only one?)]


>Choosing a namespace and publishing your vocabulary
>
>Good on-line documentation for vocabulary terms helps people read 
>and write RDF data. Writers need to see how a term is supposed to be 
>used; readers need to see what it is supposed to mean. People 
>developing software which uses the terms need to know in particular 
>detail exactly what each URI means.
>
>If you document your vocabulary using the RDF Schema and OWL 
>vocabularies, then your documentation will be machine-readable in a 
>variety of interesting and useful ways, as mentioned above and 
>covered in more detail in Vocabulary Documentation. This kind of 
>RDF-documentation-in-RDF is sometimes called a "schema" or an 
>"ontology."
>
>The easiest way to help people find your documentation is to make 
>the URIs you create as vocabulary terms also work in a web browser. 
>This happens automatically if you follow the naming convention we 
>use here, where the vocabulary definition document has a URI like 
>http://example.com/terms and it refers to its terms like <#Woman>. 
>With the @prefix declaration above, this gives the URI 
>http://example.com/terms#Woman which should work in any browser to 
>display the definition document.
>
>Ideally, you should publish your documentation on the web using a 
>server and portion of URI-space which are owned by an organization 
>which can commit to maintaining them well into the future. That way, 
>many years down the road, RDF data using your terms will still be 
>documented and potentially understandable. The convention of putting 
>the current year into the URI can help with stability; some day 
>people may be tempted to re-use http://example.com/food-vocabulary, 
>but they will probably only touch 
>http://example.com/2003/food-vocabulary, when they really mean to 
>upgrade the documentation there. In some circumstances you can also 
>achieve increased stability by using a specialized domain name which 
>may be insulated from possible organizational renaming and trademark 
>issues.
>
>Of course if you are just playing around, you can use a file (say 
>mydb.n3) in the same directory as the rest of your work. When you do 
>that, your can simply use <mydb.n3#> as your namespace identifier, 
>because in N3 (as in HTML), the URIs can be specified relative to 
>the current location.
>
>
>More
>
>Now you know all you need to start creating your own vocabularies, 
>or ontologies, and you have pointers to where to look for the richer 
>ways of defining them.You don't have to go any further, as what you 
>have now will allow you to create new applications, and create 
>schemas, data files, and programs which interchange and manipulate 
>data for the semantic web.
>
>At this point, you should be getting the hang of it and be writing 
>stuff. To give you some more ideas, though, there is a longer list 
>of more complex and varied examples. These come with less tutorial 
>explanation.
>
>Or, you can continue with a tutorial which goes into mroe features 
>of the language, explaining how to process you data and involve 
>other data on the Web. In that case, next bit is about: Shortcuts 
>and long cuts

[KD: typo mroe -> more]

>References
>
>     * Many More Examples
>     * Notation3 - Design Issues article



-- 
Karl Dubost / W3C - Conformance Manager
           http://www.w3.org/QA/

      --- Be Strict To Be Cool! ---
Received on Wednesday, 23 April 2003 20:39:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:29 GMT