0

We have a triple store of information such as drugs and I'm unsure how I can extract this information to make it available so that it can be indexed by our search engine Elasticsearch. I had envisaged that I would run a SPARQL query to extract the following information:

  • Title
  • Body
  • Href

Please not the triple store does not contain the above structure it's a lot more complicated than that.

One of the requirements is to be able to format the Titles using different triples from the triple store so for example for drugs something like this would be needed:

Paracetamol | Introduction | Drug

(Pracetamol refers to the drug name, Introduction is a subsection and Drug refers to the type)

For the body I was thinking of extracting all the text values from all the triples related to drugs.

And for the href simply using the uri of the resource(drug).

I would then convert this information to JSON-LD so that it can be indexed by Elasticsearch. In the end the JSON-LD will simply contain the title, body and href.

So my question is, is using SPARQL the right approach for what I'm wanting to do or should I look at a different approach to extract the data I need based on the requirements above.

Imran Azad
  • 1,008
  • 2
  • 12
  • 30
  • SPARQL is a good approach to get data out of a triplestore but the data you describe ("title", "body", "href", "introduction") doesn't resemble RDF. But if you have a triplestore and want to get data out of it in a structured way then SPARQL is a good choice. You could also dump the triplestore (as RDF/XML e.g.) and transform it to JSON-LD and create your index from that. – kba Feb 18 '16 at 22:13
  • 1
    @kba Thanks for the response, really appreciate it. You are correct "title", "body" and "href" isn't RDF but that's what I want extract from the RDF but the challenge here I think is generating the titles since the titles is composed of labels from different triples, for example I've been looking at using bind and concat to format the titles. I just wanted to make sure going down this path was the right approach. – Imran Azad Feb 19 '16 at 11:15
  • 1
    Have you considered using a triplestore that does full-text search out of the box? There are several that support that feature. The best approach is to not re-invent the wheel. – Michael Feb 19 '16 at 12:37

0 Answers0