0

I have template which creates triple from XML. Now I want to insert these triples in ML DB as RDF document/triples. Below is the code which I am using to insert the triples but it is inserted as XML doc and not as triples.

enter image description here

oɔɯǝɹ
  • 7,219
  • 7
  • 58
  • 69
Anuj Gupta
  • 31
  • 4
  • by the way, it would have been easier to answer your question if you'd pasted the code instead of a link to an image. See the [formatting notes](https://stackoverflow.com/editing-help#code) on how to make the code look good. – Dave Cassel Feb 08 '18 at 20:58

1 Answers1

1

First, it's worth noting that if you insert your template into MarkLogic, it will automatically put the triples into the index, without the need to materialize them in documents. That would be the standard approach. Take a look at the Template Driven Extraction tutorial for example code showing how to do this. (The first part of the tutorial works with rows, but the second part addresses triples.)

That said, if you really want to material the triples, then you should use sem:rdf-insert to do it. This way, you'll be creating managed triples. If you want to isolate them from other triples for any reason, specify a graph in the sem:rdf-insert call.

Dave Cassel
  • 8,352
  • 20
  • 38