Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query returns empty result #6

Open
duncdrum opened this issue Feb 20, 2018 · 5 comments
Open

query returns empty result #6

duncdrum opened this issue Feb 20, 2018 · 5 comments

Comments

@duncdrum
Copy link

duncdrum commented Feb 20, 2018

the following sparql returns the expected 230 result on wikidata query service (see link).
However, when started from inside exist

xquery version "3.1";
import module namespace sparql = "http://exist-db.org/xquery/sparql" at java:org.exist.xquery.modules.rdf.SparqlModule";

declare namespace sr = "http://www.w3.org/2005/sparql-results#";

let $query := ("PREFIX wikibase: <http://wikiba.se/ontology#>
                PREFIX wdt: <http://www.wikidata.org/prop/direct/>
                PREFIX wd: <http://www.wikidata.org/entity/>
                PREFIX bd: <http://www.bigdata.com/rdf#>

                SELECT ?item ?itemLabel 
                WHERE { ?item wdt:P31 wd:Q836688.
                SERVICE wikibase:label { bd:serviceParam wikibase:language '[AUTO_LANGUAGE],zh'. }
}")

return
    sparql:query($query)

I get:

<sr:sparql xmlns:sr="http://www.w3.org/2005/sparql-results#">
    <sr:head>
        <sr:variable name="item"/>
        <sr:variable name="itemLabel"/>
    </sr:head>
    <sr:results/>
</sr:sparql

Am I doing something wrong, or is there a bug?

eXist 4.0.0
exist-sparql 0.1-snapshot (build from source)
java 1.8.0_162
macOS 10.13.3

@ljo
Copy link
Owner

ljo commented Feb 21, 2018

@duncdrum I will look into it. We unfortunately have a two day consortium meeting just starting so I am not sure it will happen before the weekend.

@PietroLiuzzo
Copy link

PietroLiuzzo commented Feb 22, 2018 via email

@wsalesky
Copy link

@duncdrum This happens to me when I forget to add the
<module id="rdf-index" class="org.exist.indexing.rdf.TDBRDFIndex"/> to conf.xml. Which happens more often then I would like to admit. Are you sure your RDF is being indexed?

@duncdrum
Copy link
Author

@wsalesky and @PietroLiuzzo thanks for chiming in and helping out. I m certain that the rdf-indexmodule is active in conf.xml and the updated readme demo runs fine.

I am, however, addressing the wikidata sparql endpoint directly, instead of running a query over locally stored rdfs. Maybe that was too optimistic, @ljo?

@adamretter
Copy link
Contributor

@duncdrum does it work with my updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants