Export filtering data

Hi everyone,

I want to export the data that I have in the Stardog database. But I don’t want to export all the data, I want to export only data that matches some specific criteria.

Let’s suppose that I have on my Database:

  • Node A (name = “nodeA” and type=“X”)
  • Node B (name = “nodeB” and type=“X”)
  • Node C (name = “nodeC” and type=“X”)
  • Node D (name = “nodeD” and type=“Y”)

And I want to export only the data where the property type is equal to “X”. This means that I would expect only in the exported file the nodes A, B and C.

Is there a way to do this? To export data based on a specific filter criteria, using the Exporter object that you provide?

Thanks a lot,
Gonçalo.

Hi,

You can use a CONSTRUCT query to accomplish this:

CONSTRUCT { ?s ?p ?o }
WHERE { 
  ?s rdf:type :X .
  ?s ?p ?o .
}

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