1
0
-1

Hi, I'm developing an application that uses DBPedia data. One step in this application is to parse the results provided by the spanish DBPedia sparql endpoint (http://es.dbpedia.org/sparql). I'm having some troubles with this. For example, If I run the following query in the web browser:

select * where {
  <http://dbpedia.org/resource/Atlanta> <http://dbpedia.org/ontology/foundingYear> ?o .
}

I get the following:

I do not know what year is 0029, but the format is correct for the type gYear (year+time zone).

However, If I perform the same query by using Jena API on the same sparql endpoint, I get different results. For example, Twinkle app, which uses Jena API, return the following result:


"0029-01-01+01:00"^^<http://www.w3.org/2001/XMLSchema#gYear> is returned, which is inconsistent because gYear can not have months or days. This causes my app fails.

I'm wondering if the sparql endpoint available in the webrowser is processing the data when it is shown or, however, these changes are provoked by the Jena API.

Thanks in advance.

Fran.

  1. Dimitris Kontokostas

    I think this was a problem with an old version of Virtuoso, maybe the Spanish DBpedia didn't update their server for some time

  2. Markus Freudenberg

    Just a comment: the wrong year is due to a sloppy use of template properties by the Wikipedia editors (fundación vs. fundación_fechas) in the Atlanta entry.

CommentAdd your comment...

3 answers

  1.  
    3
    2
    1

    A few thoughts.

    Edited to add --

    • As I said earlier, the data in the Spanish DBpedia appears to be old and incorrect, and it is currently hosted by an old Virtuoso binary. You may benefit by setting up your own local Virtuoso instance with a current binary, and loading it with the new 2016-10 DBpedia dataset.

    • JDBC (and Jena) access is a separate question.  On that front, note that --

      jdbc:virtuoso://dbpedia.org:1111

      -- targets a different machine, and hence a different Virtuoso instance, than --

      jdbc:virtuoso://es.dbpedia.org:1111

      The latter currently appears to be open (that may change), but executing queries there would still require a username and password.

      CommentAdd your comment...
    1.  
      1
      0
      -1

      Thanks for your answers. Finally I am going to move to english DBPedia due to the maintenance of a spanish DBPedia fork is not expected in my project.

      Thanks again. Regards,

      Fran.

      1. Markus Freudenberg

        Just wanted to point out that setting up your own spanisch DBpedia endpoint is not so hard to do as well, especially with Dockerized DBpedia. This could also be used in concert with the official endpoint (i.e. federated queries...).

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi Ted Thibodeau Jr and Dimitris Kontokostas, thanks for your answers.

      I'm using the following method with Jena API (version 3.3.0):
          public ResultSet executeSparqlQuery(String endpoint, String query) {
              ResultSet results = null;
              QueryExecution queryExecution = QueryExecutionFactory.sparqlService(endpoint, query);
              results = ResultSetFactory.copyResults(queryExecution.execSelect());
              queryExecution.close();
              return results;
          }

      Now, I'm trying to use the jena provider and the JDBC driver you mentioned, but I think I cant get a connection to DBPedia by this way. I was looking for the jdbc url to connect to Virtuoso DBPedia server and I found this thread where a person is saying that this method is not possible because DBPedia SQL is not public. What I'm trying is the following:

          public ResultSet executeSparqlQuery(String query) {
              ResultSet results = null;
              String server = "jdbc:virtuoso://es.dbpedia.org:1111";
              VirtGraph set = new VirtGraph (server,"","");
              Query sparql = QueryFactory.create(query);
              QueryExecution queryExecution = VirtuosoQueryExecutionFactory.create (sparql, set);
              
              results = ResultSetFactory.copyResults(queryExecution.execSelect());
              queryExecution.close();
              return results;
          }

      But I'm getting no route to host exception.

      I'm also tried an online sparql client, but the results is the same ("0029-01-01+01:00" instead of "0029+01:00").

      Thanks again and regars,

      Fran.

      1. Ted Thibodeau Jr

        See my expanded answer.

      CommentAdd your comment...