Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] sparql query using datatype properties

babar shahzad babarathotmail at yahoo.com
Tue Mar 24 09:51:18 PDT 2009


Given this example earlier:

PREFIX : <http://yournamespace.com/goes/here/>

SELECT ?serial_number
WHERE {
   :DELL1234 :hasSerialNumber ?serial_number .
}

Note that :Computer isn't needed here, since you are working with a  
specific individual, if you wanted the serial numbers of all Computers:

PREFIX : <http://yournamespace.com/goes/here/>
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?serial_number
WHERE {
   ?computer rdf:type :Computer ;
            :hasSerialNumber ?serial_number .
}


when I test Individual case, it works, but the 2nd that supposed to select all instances doesn't. Message appears ''no matches found". 
Human
 ->Male (individuals)(hasName)
 ->Female (individuals)(hasName)

Screen shot is attached.

thanks for any kind of help


 
Babar Shahzad Chaudary, 
+358408532112         
Deptt of Information Processing
Science,
University of Oulu, Finland.



----- Original Message ----
From: James Howison <james at howison.name>
To: User support for the Protege-OWL editor <protege-owl at lists.stanford.edu>
Sent: Thursday, January 15, 2009 5:50:35 PM
Subject: Re: [protege-owl] sparql query using datatype properties


On 15 Jan 2009, at 10:23 AM, Mudunuri, Vekata Rajashekar Varma wrote:

> Hi,
>
> Is it possible to query the data type properties using sparql queries?
> If so, can you provide a simple example!
>
> Suppose there is a concept Computer, and an individual DELL1234, and a
> datatype property 'hasSerialNumber' with the value XYZ123

PREFIX : <http://yournamespace.com/goes/here/>

SELECT ?serial_number
WHERE {
   :DELL1234 :hasSerialNumber ?serial_number .
}

Note that :Computer isn't needed here, since you are working with a  
specific individual, if you wanted the serial numbers of all Computers:

PREFIX : <http://yournamespace.com/goes/here/>
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?serial_number
WHERE {
   ?computer rdf:type :Computer ;
            :hasSerialNumber ?serial_number .
}

> Now I want to query for the value of the serial number of DELL1234...
> can we achieve that using sparql? Can SWRL manage this as well?

SWRL isn't a query language, it's a way of declaring particular  
semantic inferences that go beyond those defined in RDF/RDFS/OWL.  eg  
you could express the statement that "all Computers with a serial  
number starting with XYZ are produced by Dell", which could result in  
a set of statements like

:DELL1234 rdf:type :DellComputer .

being added to your model.

Now I'm sure that SQWRL could help, it is a query language :)

--J
_______________________________________________
protege-owl mailing list
protege-owl at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 



      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPARQL - err.JPG
Type: image/jpeg
Size: 181409 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20090324/63479e45/attachment.JPG>


More information about the protege-owl mailing list