hans23
hans23

Reputation: 1054

How can I distinguish SQL triples from explicit triples?

I am using Template Driven Extraction to generate an SQL view and RDF triples from the same set of documents. The SQL view is used for quick inspection of the raw data, while the triples are used downstream to feed information to a knowledge graph.

I now need to extract the RDF triples into an external file, and I'm struggling with separating out those triples that back the SQL view. The documentation suggests that I should use fixed subjects or predicates in my Sparql query, which is something I can't do because I don't know either of the two beforehand. I tried filtering out the SQL triples in XQuery, but I could not devise a way to detect whether a certain value returned by sem:sparql or a triple returned by cts:triples was one of SQL's or mine.

Any help on how to get a dump of all non-SQL triples out of MarkLogic would be appreciated.

Thanks, Hans

Upvotes: 2

Views: 155

Answers (2)

Alexander Holland
Alexander Holland

Reputation: 164

You could try to use the function tde:node-data-extract. It basically lets you see the results of a document and TDEs. While it may involve some work doings this with all documents and converting it into RDF again it should be possible.

Upvotes: 0

grtjn
grtjn

Reputation: 20414

Subjects from SQL views are not real sem:iri's (they are sql:rowID's), so you can use the following to exclude them:

FILTER( ISIRI(?subject) )

HTH!

Upvotes: 2

Related Questions