Reputation: 319
I have rdf structure like this
<owl:Thing rdf:about="http://hust.se.vtio.owl#atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi">
<rdf:type rdf:resource="http://hust.se.vtio.owl#ATM"/>
<rdfs:label xml:lang="vn"><![CDATA[ATM - Techcombank]]></rdfs:label>
<rdfs:label xml:lang="en"><![CDATA[ATM - Techcombank]]></rdfs:label>
<hasLatitude rdf:datatype="&xsd;double">20.9954529</hasLatitude>
<hasLongtitude rdf:datatype="&xsd;double">105.8546176</hasLongtitude>
<hasGeoPoint rdf:datatype="http://franz.com/ns/allegrograph/3.0/geospatial/spherical/degrees/-180.0/180.0/-90.0/90.0/5.0">+20.9954529+105.8546176</hasGeoPoint>
<hasLocation rdf:resource="http://hust.se.vtio.owl#atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi-address"/>
<belongToBank rdf:resource="http://hust.se.vtio.owl#techcombank"/>
<hasMedia rdf:resource="http://hust.se.vtio.owl#atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi-images"/>
How can I get label
and Latitude
... by sparql
when I know uri :
http://hust.se.vtio.owl#atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi
Upvotes: 0
Views: 317
Reputation: 3301
It depends on how you have defined the ontology. For example, let's imagine that you have defined something like x subClassOf: hasLatitude value 20.9954529
, then you can ask a similar query to the one below:
prefix :<http://hust.se.vtio.owl#>
SELECT *
WHERE { ?s rdfs:label ?label.
?s rdfs:subClassOf ?o.
?o owl:onProperty :hasLatitude.
?o ?x ?y.
}
You can filter ?s
to only give you answers for atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi
. For example, filter (?s=:atm-techcombank-127-pho-minh-khai-hai-ba-trung-ha-noi)
.
Upvotes: 1