3

Say I have a table from a relational database.

What is the preferred method for mapping these into triples/RDF in MarkLogic 8?

So instead of:

<orders>
  <order>
    <number>1</number>
    <name>Sam Smith</name>
  </order>
....
</orders>

I end up with:

<triples>
  <triple>
    <subject>http://example.com/order</subject>
    <predicate>http://example.com/order/number</predicate>
    <object datatype="http://www.w3.org/2001/XMLSchema#integer">1</object>
  </triple>
  <triple>
    <subject>http://example.com/order</subject>
    <predicate>http://example.com/order/name</predicate>
    <object datatype="http://www.w3.org/2001/XMLSchema#string">Sam Smith</object>
  </triple>
  ....
</triples>

I need to know if this is something that we just need to manually develop or are there tools to provide mappings and namespaces and generate these?

Kal
  • 1,659
  • 10
  • 15
Tutan Ramen
  • 1,129
  • 1
  • 7
  • 23
  • It's perhaps not relevant to your specific problem, but it's worth pointing out that this sem:triple-syntax is still a MarkLogic-specific XML syntax, and not a standard RDF syntax format. It should be relatively easy to convert though. – Jeen Broekstra Jun 06 '15 at 07:38

1 Answers1

2

If you do not want to keep the original documents (and enrich them with triples), but instead to store only triples, the easiest is to generate the triples. The preferred way to do this is indeed to generate the sem:triples documents yourself.

The key point to take into account is how to group triples in a document. As triples are stored in a document, like any other document in MarkLogic, grouping them in logical units makes it easy to "insert them all together", or "delete them all together".

This depends on the entities you are representing (at the conceptual level) and the relations between them.

Florent Georges
  • 1,868
  • 1
  • 14
  • 21