Showing posts with label URI. Show all posts
Showing posts with label URI. Show all posts

# How to query SPARQL with spaces?

 RDF itself uses RDF URI references. The SPARQL query language, on the other hand, uses IRIs (the reason is that RDF predates IRIs and the notion of RDF URI references was developed in anticipation of what IRIs were expected to eventually look like. They almost got it right :)).


RDF URI references allow whitespaces while IRIs do not. 

Another way of doing this is by using FILTER (STR(?Y)) "your url") like below:


PREFIX owl:  

SELECT ?y 

WHERE { 

   ?y owl:sameAs ?x

   FILTER (str(?x) = "http://website.com/urls/playing fun")

}

[1]. http://stackoverflow.com/questions/9055146/querying-with-spaces-sparql

Hash and Slash in URI

There is URI using slash(/) for specific resources.

http://purl.org/dc/elements/1.1/title

There is URI using hash(#) for specific resources.

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

The TAG resolution takes the pragmatic view that both are OK. Then, what's the difference between those expressions?

While you are calling URI with slash for a specific resource like "http://purl.org/dc/elememts/1.1/title", it will be redirected from the URI for the thing to the URI for the document about it.

With hash, the information is easy to publish using an editor for RDF files and since the client looking up the URI just strips of the right part and get access to the document about it (http://www.w3.org/1999/02/22-rdf-syntax-ns), the speed of processing time is an advantage.


The difference between hash and slash in URI



IRI, URI, URL and URN

IRI : (Internationalized Resource Identifier), compare to URI, it's characters are Unicode which means including Chinese, Japanese and Koreans etc.

URI : (Uniform Resource Identifier ), includes URL and URN.

URL : (Uniform Resource Locator), usually using specific protocols to locate resource within World Wide Web is the most common type of URI.

URN : (Uniform Resource Name), is also one of the URI type with urn:scheme and the typical use example is ISBN system.