Hi Prashanth,
On 03/20/2013 06:11 PM, Prashanth Swaminathan wrote:
Hi,
I'm kinda new to Dbpedia and semantic web as such.
I'm trying to get the predicate of my query, so I'm trying to do a
string match from the natural language query that I have.
Eg:
Q: "What is the batting average of Sachin Tendulkar"
I use this query to find the predicates :
SELECT ?predicate ?label WHERE {{
?predicate <http://www.w3.org/2000/01/rdf-schema#label> ?label .
?predicate <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
?propertyType.
?label bif:contains '"batting average"'}
filter ( ?propertyType =
<http://www.w3.org/2002/07/owl#DatatypeProperty> ||
?propertyType = <http://www.w3.org/2002/07/owl#ObjectProperty> ||
?propertyType =
<http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> )
} limit 30
I got this, when I ran the query:
Predicate:
http://dbpedia.org/property/battingAverage
label: "batting average"@en
The result is agreeably, but when I see the page of
http://dbpedia.org/page/Sachin_Tendulkar
Resource "dbpedia:Sachin_Tendulkar" uses property "dbpprop:batAvg" which
has label "bat avg" not "batting average".
So, you should simply use "bat avg" in your query as follows:
SELECT ?predicate ?label WHERE {{
?predicate rdfs:label ?label .
?predicate rdf:type ?propertyType.
?label bif:contains '"bat avg"'}
FILTER ( ?propertyType = owl:DatatypeProperty ||
?propertyType = owl:ObjectProperty ||
?propertyType = rdf:Property )
} LIMIT 30
I see that he has a property called
http://dbpedia.org/property/batAvg and not
http://dbpedia.org/property/battingAverage
And the same goes with the http://dbpedia.org/property/odishirt and
http://dbpedia.org/property/odishirtNo.
I'm pretty sure I'm doing a mistake somewhere, but not sure where :|
So my question is :
* Is this the only way to match a string with a property? ( the
query way )
* Why do we have 2 properties for the same purpose ?
With regard to the properties, that thread might clarify the issue [1].
So, in order to standardize the usage of properties we managed to build
our mappings wiki [2].
Thanks!
P.S: Please do let me know if this question is not appropriate for
THIS mailing list. I'm not sure if I can ask questions about finding
the predicate and all.
--
Regards
Prashanth Swaminathan
[1]
http://www.mail-archive.com/dbpedia-discussion@lists.sourceforge.net/msg00170.html
[2] http://mappings.dbpedia.org/
--
Kind Regards
Mohamed Morsey
Department of Computer Science
University of Leipzig
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion