Stardog Querying with .nt and .ttl

I’m trying to run some queries on an RDF dataset.
I have the dataset in .ttl and .nt.

The DB created with the .ttl version of the data returns triples whereas the DB created with the .nt version of the data returns 0 items.

Please help, I need to work with the data in .nt format

Hi,

Please include further details such as the query executed, the data in the database under both situations and what the expected result is. Please review the summary section at the bottom of How to Report Bugs Effectively.

Jess

Thanks Jess,

I created the DB like this:

./stardog-admin --server http://126.31.44.211:5804 db create -n myDB1 /home/ntp_data.ttl
./stardog-admin --server http://126.31.44.211:5804 db create -n myDB2 /home/ntp_data.nt

I went on to this link: http://126.31.44.211:5804

I Clicked myDB1

Clicked on Query and pasted the query below:

PREFIX : <http://sws.ifi.uio.no/vocab/npd-v2#>
PREFIX isc: <http://resource.geosciml.org/classifier/ics/ischart/>
PREFIX nlxv: <http://sws.ifi.uio.no/vocab/norlex#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX npd: <http://sws.ifi.uio.no/data/npd-v2/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX ex: <http://example.org/ex#>
PREFIX quest: <http://obda.org/quest#>
PREFIX diskos: <http://sws.ifi.uio.no/data/diskos/>
PREFIX nlx: <http://sws.ifi.uio.no/data/norlex/>
PREFIX ptl: <http://sws.ifi.uio.no/vocab/npd-v2-ptl#>
PREFIX npdv: <http://sws.ifi.uio.no/vocab/npd-v2#>
PREFIX geos: <http://www.opengis.net/ont/geosparql#>
PREFIX sql: <http://sws.ifi.uio.no/vocab/sql#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX diskosv: <http://sws.ifi.uio.no/vocab/diskos#>
SELECT ?licenceURI ?company ?date 
WHERE {
    ?licenceURI a npdv:ProductionLicence .
    		
    [ ] a npdv:ProductionLicenceOperator ;
      	npdv:dateOperatorValidFrom ?date ;
      	npdv:licenceOperatorCompany [ npdv:name ?company ] ;
      	npdv:operatorForLicence ?licenceURI .

	FILTER(?date > "1979-12-31T00:00:00"^^xsd:dateTime)
    
} ORDER BY ?licenceURI

Over 1000 items returned.

But when I ran the same query on myDB2 I got 0 items returned.

Both ntp_data.ttl and ntp_data.nt are the same dataset but in different format. (i.e. .ttl and .nt)

A few questions. Presumably the contents of the files are not the same if you’re getting different results from the same query.

  • Do both DBs report the same index size in the admin page?
  • Did you try running a ?s ?p ?o query on DB2 to see if the data is correct?
  • Are there any warnings/errors reported in your stardog.log file?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.