I have built an ontology using Protégé, but how to write data to it? Do we need to have separate database? I followed this link. Now the database has been created in SQL but I am not getting how to put data there. And how to match the tables and columns according to ontology? Do I need to create all that manually or any import can be made?
2 Answers
What I have understood from the question is, you have developed an ontology, i.e. few classes, relations among the classes and few SWRL rules (if there are).
Now, what you need to do is, your data needs to be converted to owl instance(i.e. SQL query result to OWL individuals(RDF) OR XML to OWL instances) and add those instances to ontology. for that you can follow different approaches.
you can see (How to create an ontology from raw data (CSV)?) for more details.
Also refer (http://protegewiki.stanford.edu/wiki/DataMaster)
Also check if the database has a feature of importing the data as either RDF or OWL.
You can do many different things, depending on your use case. It seems that what you want is to convert the data in your SQL database in data complying with the ontology. So basically, you want to produce RDF triples from your database, if I see it right.
One way to do that is to use the W3C R2RML standard, which is a language for specifying a mapping from relational data to RDF data. There are several implementations that either apply the mapping once to the data to produce RDF, or that simply convert queries expressed in SPARQL into corresponding SQL queries. So you can manipulate your data as if they were RDF, while in fact it is still SQL under the hood.
Otherwise, you can also transform your database completely to RDF and store it in a triplestore. Triplestores are getting more and more efficient and scalable, so it's a viable option.

- 5,314
- 18
- 36