(This page is still under construction.)


Some help (such as sample SPARQL queries) can be found on answers.semanticweb.com and/or Stack Overflow. The most recent 10 posts for each site should be seen in the Feeds section, lower down on this page. Full searches are linked here --


If the information you need cannot be found there, you can:

  1. create a new post on one of the Overflow sites and use the tag “dbpedia”
  2. check the DBpedia support page .

Feeds

(Still not displayed correctly, we are working on aggregating the feed)

answers.semanticweb.com

DBPedia resource - timestamp

Hi,

Is there currently any way to get a timestamp about a DBPedia resource as http://dbpedia.org/resource/Europe

The goal would be, in a scenario where a local copy of a resource is needed, to detect that a newer version has been published and then update the local copy.

It seems that the http-header "last-modified" is empty.

Or could we use the http-header "expires" data, but this doesn't seem to really reflect that the RDF data has been updated, does it ?

I guess there isn't a VoID description available for those linked data accessed from their URL ?

Thank you for any pointer
Fabian

Sparql query on Dbpedia with different languages

I have a wiki page and from the infobox I want to retrieve some specific informations from dbpedia. With respect to dbpedia infobox_properties_definitions available online I'm able to achieve my goal but only under "en" language. An example: the following query works fine ("images shield" comes directly from the infobox page of Pergine_Valsugana ):

select ?value where {
?propName rdfs:label "image shield"@en .
dbpedia:Pergine_Valsugana ?propName ?value
}

but if I try the same for "it" wikipedia page in which "image_shield" is replaced with "Stemma" I dont get any result (I should have one because downloading the infobox_properties_en_uris_it.nt from dbpedia the triple I'm looking for is present and "Stemma" definition as well in infobox_property_definitions_en_uris_it.nt) Here is the query with no result:

select ?value where { 
?propName rdfs:label "Stemma"@it .
dbpedia:Pergine_Valsugana ?propName ?value
}

Thanks

DBpedia Statistics without SPARQL

Hi everyone, I'm trying to make some statistics on the DBpedia Dataset. The first approach I used was making SPARQL queries. It turns out as explained in this previous discussion that Virtuoso is bugged and it is not possible to retrieve the desired numbers. So, in order to overcome the problem I dowloaded DBpedia as Tables for querying the data in a way different from SPARQL.

I want to retrieve which are the numbers of triples that connnect each pair of classes in the Dbpedia ontology. Since the SPARQL approach failed which tools can I use? What do you suggest? MongoDB is a good choice for dealing with this kind of data? What about Neo4j? Is there other solutions? is this the wrong approach?

dbpedia query

Hello all! I want to query dbpedia link text so that it shows the external links of every object separated by "," and i am writing:

SELECT ?x ?title (group_concat(distinct ?ext;separator="; ") as ?exts)
      WHERE 
      {   ?x rdfs:label ?title .
          ?x dbpedia-owl:wikiPageExternalLink ?ext .
      } GROUP BY ?x ?title ?exts
LIMIT 10

But I am getting an error "Virtuoso 37000 Error SP031: SPARQL compiler: Variable 'exts' is used in the query result set but not assigned"

What am i doing wrong?

Update So I've put an "s"

SELECT ?x ?title (group_concat(distinct ?ext;separator="; ") as ?exts)
          WHERE 
          {   ?x rdfs:label ?title .
              **?x dbpedia-owl:wikiPageExternalLink ?exts .**
          } GROUP BY ?x ?title ?exts
    LIMIT 10

but know i am getting the error "Virtuoso 37000 Error SP031: SPARQL compiler: Variable 'ext' is used in the query result set but not assigned"

Thanks again and sorry for my mistake above. I am searching for many external links, not many titles. So the code above is updated.

But it is weird because in this sparql endpoint link text the code words:

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
select ?c ?s (group_concat(distinct ?y;separator="; ") as ?ys)
FROM <http://data.open.ac.uk/context/oro>
where {?c dct:title ?s .
 ?c dct:creator ?k .
 ?k foaf:name ?y .
}group by ?c ?s ?ys

How to traverse skos:broader property

Any help in my learning will be highly appreciated.

Problem statement:

Need to print list of tourist places in various cities

I have http://dbpedia.org/page/Category:Tourism_by_city category which i have to explore. The problem is this category is a skos:broader of various other categories like http://dbpedia.org/page/Category:Tourism_in_Bratislava which in itself is a skos:broader of http://dbpedia.org/page/Category:Visitor_attractions_in_Bratislava which contains dcterms:subject property and which is the list of tourist places. I have to explore all cities starting from Tourism_by_city category.

Please do let me know if question is unclear. Thanks

bulk loading DBpedia in Virtuoso

I am trying to load dbpedia datasets onto Virtuoso on windows 7.

I use the command ld_dir and I follow it with SELECT * FROM DB.DBA.LOAD_LIST; and it seems to be fine. But once I run the rdf_load_run the laptop keeps beeping and command line freezes, until I close it.

I tried modifying the NumberOfBuffers and the MaxDirtyBuffers in virtuoso.ini but that did not have any effect. I also tried with the quand store upload, but that didnt work either.

Does that mean that the 4 GB RAM I have is not enough to upload it?

Extract a subset of triples from Jena TDB database

I downloaded several of the datasets from dbpedia.org, because I am creating a quiz application where I will use data from dbpedia for creating questions and answers.

The problem is that after loading the datasets into my TDB database, the database is now about 10GB, and I still need to add some more data from dbpedia. The last dataset I added took almost 2 days to add and many queries are now very slow.

Is there any way for me to extract a smaller subset from my current TDB database and use only this subset for the database in my quiz application? For instance at first I would like to extract all persons with a yago category containing the strings "Norway" or "Norwegian" and all data directly related to these persons.

I have read about CONSTRUCT queries, but am not sure if this is what I am looking for.

Thanks!

how to query dbpedia using jena java?

Hello everyone and experts, i am novice user in using sparql query for dbpedia data. what I want to do is to query the Computer Scientist publications DBLP in java: like this following link do http://dbpedia.org/snorql/?query=SELECT+*+WHERE+%7B%0D%0A%3Fsubject+owl%3AsameAs+%3Flink.%0D%0A%3Fsubject+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fclass%2Fyago%2FProgrammer110481268%3E%0D%0A%7D+LIMIT+20 I use that query in java as follows.

String service = "http://dbpedia.org/sparql";
String query="  PREFIX owl: <http://www.w3.org/2002/07/owl#>"+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>"+
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>"+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>"+
"PREFIX dc: <http://purl.org/dc/elements/1.1/>"+
"PREFIX : <http://dbpedia.org/resource/>"+
"PREFIX dbpedia2: <http://dbpedia.org/property/>"+
"PREFIX dbpedia: <http://dbpedia.org/>"+
"PREFIX skos: <http://www.w3.org/2004/02/skos/core#>"+
    "SELECT * WHERE {"+
    "?subject owl:sameAs ?link."+
    "?subject rdf:type <http://dbpedia.org/class/yago/Programmer110481268>"+
    "} LIMIT 20";

            QueryExecution qe=QueryExecutionFactory.sparqlService(service, query);
            ResultSet rs=qe.execSelect();
            while(rs.hasNext()){
                System.out.println(rs.next());
            }

///////////////////
that code gave following error

Exception in thread "main" HttpException: java.net.SocketException: Connection reset: java.net.SocketException: Connection reset
at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:333)
................................

but the other code can link the dbpedia and give the results, but, they are not what I wanted.

String sparqlQueryString = "select distinct ?Concept where {[] a ?Concept } LIMIT 10";
Query query = QueryFactory.create(sparqlQueryString);
QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);

So, anyone has some idea to query in java like they do in "http://wiki.dbpedia.org/Datasets" Any help is appreciated and thanks you very much in advance.

Query combination using multiple subqueries

I want to count the predicates between two set of entities. Each set has entities of the same DBpedia class (i.e. Person or Organisation). Moreover, each entity E has a certain class C as rdf:type and no other rdf:type x where x is a subclass of C.

Hence, for retrieving one entity set (Person) we can run this query:

PREFIX dbp: <http://dbpedia.org/ontology/>
SELECT ?e1 {
    ?e1 a dbp:Person .
    FILTER NOT EXISTS { 
        ?subclass1 rdfs:subClassOf+ dbp:Person . 
        ?e1 a ?subclass1 .
        FILTER (?subclass1 != dbp:Person ) . 
    }
}

We can do the same thing for the other set (Organisation):

PREFIX dbp: <http://dbpedia.org/ontology/>
SELECT ?e2 {
    ?e2 a dbp:Organisation .
    FILTER NOT EXISTS { 
        ?subclass2 rdfs:subClassOf+ dbp:Organisation . 
        ?e2 a ?subclass2 . 
    }
}

I combined the two queries in this way for achieving the purpose described above:

PREFIX dbp: <http://dbpedia.org/ontology/>
SELECT (COUNT(?p) AS ?cont) {
    ?e1 ?p ?e2 .
    ?e1 a dbp:Person .
    ?e2 a dbp:Organisation .
    FILTER(NOT EXISTS { 
        ?subclass1 rdfs:subClassOf+ dbp:Person . 
        ?e1 a ?subclass1 .
        FILTER (?subclass1 != dbp:Person ) . 
    })
    FILTER(NOT EXISTS { 
        ?subclass2 rdfs:subClassOf+ dbp:Organisation . 
        ?e2 a ?subclass2 . 
        FILTER (?subclass2 != dbp:Organisation ) . 
    })
}

The endpoint return this error. So, i rewrite the query using subqueries (I do not perform the count for checking the entity results):

PREFIX dbp: <http://dbpedia.org/ontology/>
SELECT ?e1 ?p ?e2 {
?e1 ?p ?e2 .

{SELECT ?e1 {
    ?e1 a dbp:Person .
    FILTER NOT EXISTS { 
        ?subclass1 rdfs:subClassOf+ dbp:Person . 
        ?e1 a ?subclass1 .
        FILTER (?subclass1 != dbp:Person ) . 
    }
}}

{SELECT ?e2 {
    ?e2 a dbp:Organisation .
    FILTER NOT EXISTS { 
        ?subclass2 rdfs:subClassOf+ dbp:Organisation . 
        ?e2 a ?subclass2 . 
        FILTER (?subclass2 != dbp:Organisation ) . 
    }
}}
}

This are the results. The problem is that while the results of the two subqueries are correct, if executed separately as shown above (first two query of the answer), the results of the combination query have entities like this one. It has rdf:type dbp:Agent and dbp:Person but it has also dbp:Scientist.

Considering that the results of the subqueries (first two query of the answer) are correct, why in the combination query there's this behaviour? Why there are undesired entities that are not included in the previous queries?

I hope the answer is clear. Thank you in advance

DBpedia Entities, rdf:type and Ontology sub-classes

I'm trying to build a query that given a certain ontology class C (like Person) returns the entities that have the rdf:type C and no other rdf:type x where x is a subclass of C (Person) and it belongs to the DBpedia ontology.

Hence if an entity has rdf:type http://dbpedia.org/ontology/Person and rdf:type http://schema.org/Person is accepted. An entity with rdf:type http://dbpedia.org/ontology/Agent and rdf:type http://dbpedia.org/ontology/Person is accepted because Agent is the father of Person in the hierarchy.

I tried to write the query in this way:

PREFIX dbp: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?entity {
    ?subclass rdfs:subClassOf+ dbp:Person .
    ?entity a dbp:Person .
    FILTER NOT EXISTS {?entity a ?subclass}
}

The results contain entities that do not fit my description above. For instance the second entity in the results has rdf:type Person but also Politician and President that are subclasses of Person.

Any hints to improve the query? (I know that the query can be built using a COUNT but I'm wonder if it is possible to write it also using rdfs:subClassOf and FILTER NOT EXISTS)

Thank you in advance



 
There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]

Information

Last Modification: 2011-07-24 20:04:59 by Sebastian Hellmann