Menu

sparql by curl, python: no results

Help
S Vista
2019-04-08
2019-04-09
  • S Vista

    S Vista - 2019-04-08

    Hi everyone,

    I'm new to blazegraph and sparql, sorry if the question is trivial.
    I have installed Blazegraph (followed instructions here ) on a Google Cloud (GC) instance. The installation went through without any problems (I'm using the default configuration, nothing is changed on my side). I also have ran runBlazegraph.sh successfully followed by an equally successful running of the munge.sh and loadRestAPI.sh scripts. All went through without errors (the loading is still underway though I'm not expecting any errors). I'm loading wikidata's latest dump to my Blazegraph instance. While loading is running, I would like to do a sanity check by running a simple query to see if there's any data in the database.

    What I did first was to go to the GUI using this link: http://localhost:9999/bigdata/#query and run a simple query like:

    select * where { ?s ?p ?o } LIMIT 100
    

    However, the query returns an empty result. Note that I had to tunnel to the GC machine in order to view the GUI.

    Thinking that perhaps I'm using the wrong URI, or maybe tunnelling to the GC machine is messing things up, I tried to run things on the GC machine itself. I also changed the URI so as to use the proper namespace (wdq in my case). I executed a Curl command like:

    curl -G http://localhost:9999/bigdata/namespace/wdq/sparql --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 100' -H 'Accept:application/sparql-results+json'
    

    which got me another empty result set. Also, found a similar question on this forum suggesting a change of bigdata to blazegraph in the Curl command above. I tried that and got another empty result. Using the wget also returned empty.

    Using the Python pymantic library as below wouldn't help either:

    from pymantic import sparql
    server = sparql.SPARQLServer('http://127.0.0.1:9999/bigdata/namespace/wdq/sparql')
    result = server.query("select * where { ?s ?p ?o } limit 100")
    

    I think I'm doing something wrong here. I don't get any errors, but I'm not getting any results either. My questions is:

    1. Maybe this is happening because the load process hasn't finished loading yet?
    2. Or perhaps it is because I'm using the wrong URI (http://localhost:9999/bigdata/#query or http://127.0.0.1:9999/bigdata/namespace/wdq/sparql). If this is the case, what would be the right one?
    3. Being a new-be in Blazegraph and Wikidata, maybe I've got it all wrong, in which case I would appreciate a link to a complete step-by-step setup guide.
     
    • Bryan Thompson

      Bryan Thompson - 2019-04-09

      I am not sure how the data is being loaded. If it is running as a single
      transaction then you will not see any data until that transaction commits.,
      transactional isolation.

      On Mon, Apr 8, 2019 at 16:06 S Vista vistas@users.sourceforge.net wrote:

      Hi everyone,

      I'm new to blazegraph and sparql, sorry if the question is trivial.
      I have installed Blazegraph (followed instructions here
      https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#Standalone_service
      ) on a Google Cloud (GC) instance. The installation went through without
      any problems (I'm using the default configuration, nothing is changed on my
      side). I also have ran runBlazegraph.sh successfully followed by an
      equally successful running of the munge.sh and loadRestAPI.sh scripts.
      All went through without errors (the loading is still underway though I'm
      not expecting any errors). I'm loading wikidata's latest dump
      https://dumps.wikimedia.org/wikidatawiki/entities/ to my Blazegraph
      instance. While loading is running, I would like to do a sanity check
      by running a simple query to see if there's any data in the database.

      What I did first was to go to the GUI using this link:
      http://localhost:9999/bigdata/#query and run a simple query like:

      select * where { ?s ?p ?o } LIMIT 100

      However, the query returns an empty result. Note that I had to tunnel to
      the GC machine in order to view the GUI.

      Thinking that perhaps I'm using the wrong URI, or maybe tunnelling to the
      GC machine is messing things up, I tried to run things on the GC machine
      itself. I also changed the URI so as to use the proper namespace (wdq
      in my case). I executed a Curl command like:

      curl -G http://localhost:9999/bigdata/namespace/wdq/sparql --data-urlencode 'query=SELECT * { ?s ?p ?o } LIMIT 100' -H 'Accept:application/sparql-results+json'

      which got me another empty result set. Also, found a similar question on
      this forum
      https://sourceforge.net/p/bigdata/discussion/676946/thread/bc9b1791/
      suggesting a change of bigdata to blazegraph in the Curl command above. I
      tried that and got another empty result. Using the wget also returned
      empty.

      Using the Python pymantic library as below wouldn't help either:

      from pymantic import sparqlserver = sparql.SPARQLServer('http://127.0.0.1:9999/bigdata/namespace/wdq/sparql')result = server.query("select * where { ?s ?p ?o } limit 100")

      I think I'm doing something wrong here. I don't get any errors, but I'm
      not getting any results either. My questions is:

      1. Maybe this is happening because the load process hasn't finished
        loading yet?
      2. Or perhaps it is because I'm using the wrong URI (
        http://localhost:9999/bigdata/#query or
        http://127.0.0.1:9999/bigdata/namespace/wdq/sparql). If this is the
        case, what would be the right one?
      3. Being a new-be in Blazegraph and Wikidata, maybe I've got it all
        wrong, in which case I would appreciate a link to a complete step-by-step
        setup guide.

      sparql by curl, python: no results
      https://sourceforge.net/p/bigdata/discussion/676946/thread/54838d50fa/?limit=25#a211


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/bigdata/discussion/676946/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.

MongoDB Logo MongoDB