0

I am currently writing some Java code extracting some data and writing them as Linked Data, using the TRIG syntax. I am now using Jena, and Fuseki to create a SPARQL endpoint to query and visualize this data.

The data is written so that each source dataset gives me a .trig file, containing one named graph. So I want to load thoses files in Fuseki. Except that it doesn't seem to understand the Trig syntax...

If I remove the named graphs, and rename the files as .ttl, everything loads perfectly in the default graphs. But if I try to import trig files :

  • using Fuseki's webapp uploader, it either crashes ("Can't make new graphs") or adds nothing except the prefixes, as if the graphs other than the default ones could not be added (the logs say nothing helpful except the error code and description).

  • using Java code, the process is too slow. I used this technique : " Loading a .trig file into TDB? " but my trig files are pretty big, so this solution is not very good for me.

  • So I tried to use the bulk loader, the console command 'tdbloader'. This time everything seems fine, but in the webapp, there is still no data.

You can see the process going fine here : Quads are added just fine

But the result still keeps only the default graph and its original data : Nothing is added

So, I don't know what to do. The guys behind Jena and Fuseki suggested not to use the bulk loader in the Java code (rather than the command line tool), so that's one solution I guess I'd like to avoid.

Did I miss something obvious about how to load TRIG files to Fuseki? Thanks.

UPDATE : As it seemed to be a problem in my configuration (see the comments of this post for a link to my config file; I cannot post more than 2 links), I tried to add some kind of specification for some named graphs I would like to see added to the dataset on Fuseki.

I added code to link (with ja:namedgraph) external graphs that I added via tdbloader. This seems to work. Great!

Now another problem : there's no inference, even when my config file specifies an Inference model... I set that queries should be applied with named graphs merged as the default graph, but this does not seem to carry the OWL Inference rules...So simple queries work, but I have 1/ to specify the graph I query (with "FROM") and 2/ no inference in my data.

Community
  • 1
  • 1
RdNetwork
  • 41
  • 8
  • "The guys behind Jena and Fuseki suggested" - do you have link to that conversation? – AndyS Jun 28 '16 at 10:10
  • Which version of Fuseki are you using? What is the configuration for /ds? – AndyS Jun 28 '16 at 10:12
  • I think it was this conversation : http://mail-archives.apache.org/mod_mbox/jena-users/201307.mbox/%3c51F8ED95.6090807@apache.org%3e Which appears to be from... you, I guess? Maybe I got the wrong interpretation of that sentence, though. – RdNetwork Jun 28 '16 at 10:25
  • I'm using Fuseki 2.4, with this configuration file, that (I think) is a very standard one: http://pastebin.com/kN5615VG (I actually made it from the default one). I'm still a beginner with this, so I may have made stupid mistakes in this. I mostly used the web interface rather than writing my own config files, but this one seemed to work. – RdNetwork Jun 28 '16 at 10:28
  • <#dataset> rdf:type ja:RDFDataset ; ja:defaultGraph <#model> You have only connected the default model to the services. – AndyS Jun 29 '16 at 13:15
  • Yes, I actually updated my configuration file, like said here for example : http://stackoverflow.com/questions/35428064/reasoning-with-fuseki-tdb-and-named-graphs/38092564#38092564 This thread is a better description of my problem right now, I guess – RdNetwork Jun 30 '16 at 08:03

1 Answers1

0

The two methods are to use the tdb bulkloader offline or you can POST data into the dataset directly. (i.e. HTTP POST operations to http://localhost:3030/ds).

You can test where your graph are there with a query like

SELECT (count(*) AS ?C) { GRAPH ?g { ?s ?p ?o } }

The named graphs will show up when the Fuseki server is started unless your configuration of the SPARQL services only exports one graph.

AndyS
  • 16,345
  • 17
  • 21
  • After importing 2 named graphs/TriG files, this returns "0", so I guess there is indeed a problem with the configuration – RdNetwork Jun 28 '16 at 10:37