views:

178

answers:

3

Hello,
I'm working on a semantic web project and I've encountered some problems about Uri & Url.

First of all, a general question: how are Uris referenced by a user application in world wide web? Are there like Urls, stored on some international servers, and the resource is given to user application, when relevant Uri is requested? I made Uris for my ontology individuals in RDF files. Is it enough to just store an Uri in my web files? How can be sure that it is unique? (for example this is for a student: #stu00546)
Second, what Uri should i give to my ontology? should I register a valid Uri to make it work on the Internet?
Last, should I store both Uris and Url, for an individual, where it's needed? For instance if I want to create an individual about a learning resource (like a Pdf), and I want the user to be able of opening this Pdf later, should I store the Url of Pdf, or I should define this individual with it's Uri, which is assigned to it by other site?

Thank you very much for your time & attention

A: 

I'm not quite sure I understand the question. Are you having some problems understanding the difference between a URI and a URL? If so, Wikipedia has a reasonable explanation.

Basically, a URI (Uniform Resource Identifier) identifies a resource. Wikipedia uses the example of an ISBN, which identifies a book, but doesn't give any information on how to access it. a URL (Uniform Resource Locator) provides information on how to access a resource; for example, the URL to the full text of a book.

Rob
Thank you sir, but I can't still understand Uri resolution, though I've read http://en.wikipedia.org/wiki/URI#URI_resolution.I would realy appreciate help in that matter.
Ehsan
+2  A: 

About URI: in general all URI cannot be referenced: for example

urn:isbn:0451450523

describes the id of a book, but there is not a standard way to find this book. Some protocols such as URL or LSID are associated with protocol that allow them to retrieve the information.

An URI for your ontology: This could be any unique URI (e.g. urn:me:onotology/mywebsite#ontology but I guess the best place would be a URL on the web where your ontology is described. See also the ontology header. For example the namespace of FOAF is http://xmlns.com/foaf/0.1/ which redirects to the specifiation.

A URL for your document (suggestion):

<foaf:Document rdf:about="http://example.org/mydoc1"&gt;
  <dc:title xml:lang="en">Title</dc:title>
  <dc:title xml:lang="fr">Titre</dc:title>
</foaf:Document>

<my:InstanceOfDoc rdf:about="http://example.org/mydoc1/pdf"&gt;
 <my:isInstanceOf  rdf:resource="http://example.org/mydoc1"/&gt;
 <my:mime-type>application/pdf</my:mime-type>
</my:InstanceOfDoc>


<my:InstanceOfDoc rdf:about="http://example.org/mydoc1/txt"&gt;
 <my:isInstanceOf  rdf:resource="http://example.org/mydoc1"/&gt;
 <my:mime-type>text/plain</my:mime-type>
</my:InstanceOfDoc>

<my:InstanceOfDoc rdf:about="http://example.org/mydoc1/html"&gt;
 <my:isInstanceOf  rdf:resource="http://example.org/mydoc1"/&gt;
 <my:mime-type>text/html</my:mime-type>
</my:InstanceOfDoc>
Pierre
Thank you so much dear sir,So I understand from your reply that for using a resource (e.g. a document) I should store a resource Url, or, make it's Uri like it's Url.Bytheway, are you defining different copies of mydoc1 in above example?
Ehsan
What you mean by "different copies of mydoc1" would be defined in YOUR ontology. e.g. <my:InstanceOfDoc> <rds:comment> "Defines a URL where we can find the document in the given format"
Pierre
I got that clearly now. Can I ask another question;Are we doing Uri resolution by this operation (codes like this)? I mean, is it our responsibility to resolve the Uri we create?
Ehsan
Ideally yes, see the SW communities Linked Data Best Practice guidelines here for advice on how to do this - http://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/
RobV
+1  A: 

The RDF specification defines how URIs are used within RDF. Don't forget about form (and secondary uses), but by far the most important aspect to your URIs is that they are globally unique identifiers. Each URI identifies a unique concept (for example, a specific OWL class) or an individual (a particular instance of that class -- the student you mention in your question) and you want to be very careful about ensuring uniqueness of your URIs.

With that in mind, a URI like #student1234 is not good, while urn:myappname:students#student1234 would be better.

For more "friendly" uses of the URI, you may want to make them dereferencable (as in the FOAF spec mentioned by Pierre or for the purposes of linked data). In this case, a URI like http://myserver.com/myappname/students/student1234 might be more appropriate.

The final thing to keep in mind is what Semantic Web for the Working Ontologist: Modeling in RDF, RDFS and OWL calls "Wishful Names". Be very careful assuming (as a human) that a URI like urn:example:cars#car123 has type ontology:Car. The URI will be opaque (and used like a key in a database) when used by a piece of software; a URI has no semantics on its own.

Beyond that, most of the form comes down to personal preference and what will benefit your application.

Phil M
Thank you very much sir, for your very helpful post.
Ehsan