0

I want to store graph data in marklogic using semantic triple. I am able to do that when i use ttl file with uri of http://example.org/item/item22.

But i want to store this triple wrt to documents which are stored in Marklogic. Means i have one document "Java KT" which is in relation to Java class, and all this data is present in marklogic , how can i create a ttl file with uri to document which is present in marklogic DB?

3 Answers3

2

Load your documents, load your triples, and just add extra triples with document uri as subject or object, and some triple entity uri as the other side. You could express those in another ttl file, or create them via code.

Next question would be, though, how you would want to use documents and triples together?

HTH!

grtjn
  • 20,254
  • 1
  • 24
  • 35
  • Thanks for replying but My question as ttl file of format : "2013-05-14"^^. What uri in respect to the document has to be written here.. What will be the document IRI – Jang Fateh Singh Aug 25 '16 at 09:20
  • If you insert a doc at `/mydoc.json`, you can refer to that in your ttl file with ``. MarkLogic is pretty tolerant about IRIs and database URIs.. – grtjn Aug 25 '16 at 12:48
0

my question is what is the IRI that i will be writing in ttl file which will be of my document available in DB. As ttl file accepts IRIs , so what is the iri for my document ? @grtjn

0

It sounds like you want to link from some existing information to your document URI.

If it's item22 from your example then it should be straight-forward. Let's say item22 is a book. Your TTL data might look like this:

PREFIX item: <http://example.org/item/>
PREFIX domain: <http://example.org/stuff/>

item:item22 a domain:Book ;
              domain:hasTitle "A tale of two cities" ;
              domain:hasAuthor "Charles Dickens" .

Let's say you have that book as a document in MarkLogic. You could simply add another triple:

item:item22 domain:contentsInUri "/books/Dickens/A-tale-of-two-cities.xml" .

Now you can use SPARQL and easily find the URI related to all the books by Dickens or books with the title "A tale of two cities".

If you are looking for more structure you look into some semantic ontologies such as RDFS and OWL.

chriskelly
  • 7,526
  • 3
  • 32
  • 50