I created an ontology using Protege and it saves as .OWL file in RDF/XML serialization.
My ontology has two main Classes.. Category and Review. I have defined the object property called isAbout which connect the category individuals and review individuals.
I have created some named individuals under both classes. Then I load my ontology using java jena and query some data using SPARQL. So far so good..
I have some review data in a MySQL table which I want to map with my ontology and query those results as well.
My database table with sample record.
------------------------------------ | Review | Rating | Category | ------------------------------------ | "Great one" | 5 | "Display" | ------------------------------------
I want to convert this data into RDF and insert those records as Review individuals into ontology. There will be an category individual which maps with Category value in the database table. So I want to link this newly created individuals using isAbout object property as well.
So how can I do this?
Ps: As a concept I want to integrate distributed data sources into a common platform. Am I on the track or doing something wrong or is there a better way to do this?
---- Update 2018/04/13 ----
I made a progress with D2RQ tool. Which allows me to map the Database tables and columns to ontology and generate RDF. Now the data in my table is represented as follow in a separate RDF.
<rdf:Description rdf:about="reviews/3">
<vocab:reviews_Category>OLED</vocab:reviews_Category>
<vocab:reviews_Rating rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3</vocab:reviews_Rating>
<vocab:reviews_Review>wow</vocab:reviews_Review>
<vocab:reviews_ID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3</vocab:reviews_ID>
<rdfs:label>reviews #3</rdfs:label>
<rdf:type rdf:resource="vocab/reviews"/>
And a sample individual in my ontology looks like
<reviews_2:Review rdf:about="http://review-analyzer.local/ontologies/reviews_2.owl#tt2">
<reviews_2:isAbout rdf:resource="http://review-analyzer.local/ontologies/reviews_2.owl#amoled"/>
<reviews_2:comment>dfgh</reviews_2:comment>
<reviews_2:rating rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>2</reviews_2:rating>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
Now the question is down to how do I combine these two RDFs to get data from SPARQL? can I do this using SWRL(Semantic Web Rule Language) ?