Hi,
I'm trying to build a knowledge graph from Wikidata using the n10s library. When I run the following using n10s.rdf.preview.fetch
I get a preview of the nodes and relationships which look correct:
WITH 'PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX sch: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
CONSTRUCT {
?band a sch:Band ;
sch:name ?bandName ;
wdt:P571 ?startYear .
?member a sch:Musician ;
sch:name ?memberName ;
wdt:P463 ?band .
?album a sch:Release ;
sch:name ?albumName ;
wdt:P175 ?band ;
wdt:P577 ?releaseDate . }
WHERE {
?band wdt:P136 wd:Q49451.
?band wdt:P495 ?country ;
wdt:P571 ?startYear ;
rdfs:label ?bandName . filter (lang(?bandName) = "en") .
?album wdt:P175 ?band ;
wdt:P577 ?releaseDate ;
rdfs:label ?albumName . filter (lang(?albumName) = "en") .
OPTIONAL {?member wdt:P463 ?band ;
rdfs:label ?memberName . filter (lang(?memberName) = "en") . }
FILTER(YEAR(?startYear) <= 1980 && ?country IN ( wd:Q145, wd:Q38 )). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }}' AS sparql
CALL n10s.rdf.preview.fetch(
'https://query.wikidata.org/sparql?query=' + apoc.text.urlencode(sparql), "JSON-LD", { headerParams: { Accept: "application/ld+json"},
handleVocabUris:"IGNORE"
}
)
YIELD nodes, relationships
RETURN nodes, relationships
However, when I run the same code but using n10s.rdf.import.fetch
I get terminationStatus: KO, triplesParsed: 0, triplesLoaded: 0
...same code...
CALL n10s.rdf.import.fetch(
'https://query.wikidata.org/sparql?query=' + apoc.text.urlencode(sparql), "JSON-LD", { headerParams: { Accept: "application/ld+json"},
handleVocabUris:"IGNORE"
}
)
YIELD terminationStatus, triplesLoaded, triplesParsed
RETURN terminationStatus, triplesLoaded, triplesParsed
Can anyone help explain why preview
is returning the triples but import
isn't doing anything?
I'm using:
Browser version: 4.3.5
Server version: 4.2.1
Neosemantics: 4.2.0.0
Thanks!