I'm currently creating an ontology for a project that deals with sensor data. I successfully created an RDF graph using RDFLib in Python. And then stored the graph using Jena TDB database. Now I want to query the database using SPARQL but I honestly don't know where to start.
For example if I m using already a knowing vocabulary lets say Friend of a Friend (FOAF) then I will simply execute a query something like this and I will get what I need:
SELECT ?name
WHERE {
?person foaf:name ?name .
}
But since I'm creating my RDF using different ontologies (a sensor ontologies) my aim is to execute this query and get all the data related:
SELECT * {?dev ?lon ?lat}
where dev is the device name , lon is the longitude where the device is located and lat is the latitude. All this data are provided within the graph but its not yet defined to be queried.
To summarize, I'm trying to figure out a prefixed name for classes and so on, for example the class device can be represented by (dev, device...)
Can assigning labels in RDFLib be the solution or do I have to develop a vocabulary for querying ?
http://something.org/sensor/hasLightnessValue, you can get the lightness value for your device that has a URIhttp://something.org/device/myDeviceas<http://something.org/device/myDevice> <http://something.org/sensor/hasLightnessValue> ?valueprefixes are just to make the query more readable for humans - William Kinaan?s ?p ?oqueries with aLIMIT, to find what data exists and find how the properties, classes, etc. are defined and used. - scotthenninger