Haroon Lone
Haroon Lone

Reputation: 2949

Using an ontology to produce semantic full information from the raw data

Problem Definition: Store sensor data (temperature readings, sensor description) into rdf form using an ontoloy. Further, use SPARQL to perform queries on stored data.

My Approach: I am not an expert in this domain, but I have some basic understanding and accordingly I am using this approach: 1. Create Ontology, 2. convert data according to ontology vocabulary, 3. store converted data into triple store, 4. Perform SPARQL queries. I am not sure whether I am following the right way. Any comments from your side will be valuable.

Till now, I have done the following:

  1. I have created an ontology in Protege 5.0.0 as Shown below for representing temperature sensor. This ontology only represents one part of full ontology.
  2. I have collected data in a CSV file which includes date, time and temperature reading as shown as
  3. Now, I want to use this ontoloy for storing the csv file in rdf form in some data store. At this step I am stuck from last three days. I have found some links like link1, link2 but still I am finding it difficult to proceed further. Do I need a script which will read csv file and perform mapping to given ontology concepts. If yes, is there a sample script which does the same? Possibly, outcome might look like:

<datetime>valX</datetime>
<tempvalue>valY</tempvalue>

Can anyone guide me in the following: 1. Am I taking correct steps to solve the problem? 2. How should I solve step 3, i.e, store data according to ontology.

P.S: I have posted this question on answers.semanticweb.com also. This is only to get the response asap.

Upvotes: 2

Views: 698

Answers (1)

Kristian
Kristian

Reputation: 21820

actually, this is a great use of D2RQ mapping language, and D2RQ server.

Go install D2RQ, then start it up with a connection to your relational database. Then generate a mapping file using their generator that comes with the software. Then you'll have a mapping file -- edit that and swap out the automatically generated ontology prefixes with your own. Their website has a page that explains how the mapping language works.

Once you've done that and there are no errors in the mapping file, you can actually query your whole relational dataset with SPARQL without even having to export it and load it in a real triplestore.

However, if you want to export and load into a triplestore, you'd just run the D2RQ generate triples functionality (Also included in d2rq server), and then import that triples file into a triplestore like Jena Fuseki.

Upvotes: 1

Related Questions