jfix / mediareview

playing around with marklogic and friends
0 stars 0 forks source link

get provider info via their url from dbpedia.org #4

Open jfix opened 9 years ago

jfix commented 9 years ago

need to find out what the URL maps to:

dbpprop:website dbpedia-owl:wikiPageWikiLink dbpedia-owl:wikiPageExternalLink foaf:homepage ...

examples:

http://de.dbpedia.org/page/The_Daily_Star_(Libanon) http://dbpedia.org/page/Haaretz

good gui for sparql queries:

yasgui.org

jfix commented 9 years ago

Here's a query draft for later use (can be run on yasgui.org or another endpoint):

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpediaowl: <http://dbpedia.org/ontology/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>

SELECT DISTINCT
    ?description 
    ?name 
    ?type 
    ?headquarter 
    ?wikipediaPage
    ?geolat
    ?geolong

WHERE {
  ?item dbpprop:website <http://www.haaretz.com>.
  OPTIONAL {
    ?item dbpprop:website <www.haaretz.com/>.
  }
  OPTIONAL {
    SELECT ?headquarter {
      ?item dbpediaowl:headquarter ?headquarter.
    }
    LIMIT 1

  }
    ?headquarter geo:lat ?geolat.
    ?headquarter geo:long ?geolong.

  OPTIONAL {
    ?item foaf:isPrimaryTopicOf ?wikipediaPage.
  }
  ?item dbpprop:name ?name.
  ?item rdfs:comment ?description.

  OPTIONAL {
      ?item dbpprop:type ?type.
  }

  FILTER (LANG(?description) = 'en') 
  FILTER (LANG(?name) = 'en') 
  FILTER (LANG(?type) = 'en') 
}

My message to the dbpedia-discuss mailing list should show up here at some stage: http://sourceforge.net/p/dbpedia/mailman/dbpedia-discussion/?viewmonth=201502