Hello,

Thanks for your response. I tried doing this but it gives me an empty
result even though I verified that the properties I am looking for exist
(even though I am not sure which Prefix to use.
For example, I tried :

PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?pl ?lbl ?r ?v
WHERE {
 { ?pl rdf:type dbpedia-owl:PopulatedPlace .
 ?v  rdf:type dbpedia-owl:PopulatedPlace .

 ?pl rdfs:label ?lbl.
 ?pl ?r ?v .
 values ?propertyType {dbpedia-owl:capital dbpprop:capital
dbpedia-owl:country dbpprop:country}
 ?r a ?propertyType .
  FILTER(?lbl="California"@en).
 }
}

LIMIT 1000

I was able to get the result with using a filter such that:
FILTER (?r a dbpedia-owl:capital || ?r a dbpedia-owl:country) .

But I am not sure if it is the best way to do it or even the right way to
do it.


Mohammad Ghufran


On Wed, Jun 4, 2014 at 4:16 PM, Joshua TAYLOR <joshuaaa...@gmail.com> wrote:

> If you just want some particular properties, then you can specify them
> with values.  E.g.,
>
> select ?p ?o {
>   values ?p { prop1 prop2 prop3 … }
>   dbpedia:Mount_Monadnock ?p ?o .
> }
>
> On Wed, Jun 4, 2014 at 9:52 AM, Mohammad Ghufran <emghuf...@gmail.com>
> wrote:
> > Hi,
> >
> > I am starting to use dbpedia for a project so my question may be very
> simple
> > but I couldn't find any resource on this so asking it here. I want to
> > extract a certain set of properties for a given resource. For example, I
> > want to get the country, longitude, latitude and isPartOf properties of a
> > resource of type PopulatedPlace.
> >
> > I know how to extract all the properties of this resource using the
> > following query but this is slow and excessive when i only just want
> > specific properties. Can anyone suggest what is a good solution for this?
> >
> > PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
> > PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
> > PREFIX dbpedia: <http://dbpedia.org/resource/>
> > PREFIX dbpprop: <http://dbpedia.org/property/>
> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> > SELECT ?pl ?lbl ?r ?v
> > WHERE {
> > {
> > ?pl rdf:type dbpedia-owl:PopulatedPlace .
> > ?v  rdf:type dbpedia-owl:PopulatedPlace .
> > ?pl rdfs:label ?lbl.
> > ?pl ?r ?v .
> > FILTER(?lbl="California"@en).
> > }
> > UNION
> > {
> > ?pl rdf:type dbpedia-owl:PopulatedPlace .
> > ?v  rdf:type dbpedia-owl:PopulatedPlace .
> > ?pl rdfs:label ?lbl.
> > ?v ?r ?pl .
> > FILTER(?lbl="California"@en).
> > }
> > }
> > LIMIT 1000
> >
> > Thanks!
> > Ghufran
> >
> >
> ------------------------------------------------------------------------------
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and
> their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/NeoTech
> > _______________________________________________
> > Dbpedia-discussion mailing list
> > Dbpedia-discussion@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
> >
>
>
>
> --
> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to