Search Mailing List Archives
[protege-discussion] DataMaster - mapping columns to class members
Csongor Nyulas
csongor.nyulas at stanford.edu
Fri Mar 21 11:35:21 PDT 2008
Dear Paul,
There is no direct way to create instances of your arbitrary classes in
the ontology from your DB tables,
because there is no way to specify the mappings between the data source
elements and ontology elements. Although
we may build something that facilitate the ontology database mapping,
this will eventually happen in the
distant future when we will need this functionality in our project.
Until then, there are a few tricky ways to achieve what you need.
Depending on at which end of the import
(DB or ontology) you have liberty of making (temporary) changes, you can
try:
a) the solution proposed by Jonathan
b) in case you can't change your DB but can make changes in your ontology:
- import the structure of the database in a temporary ontology, in
order to check the names of the classes
and properties. Pay attention also to the generated namespaces
- rename the classes and properties in your ontology to exactly
match (including the namespaces) the structure
in the temporary ontology
- import the instances in your ontology using DataMaster
- rename the classes/properties in your ontology to their original names
This solution is good if you do not have too many tables, and you do not
have to repeatedly import from the database
c) in case neither a) or b) is convenient import the instances in your
ontology with DataMaster and use the
ProtegeScriptTab, or SQWRL rules to create corresponding instances in
your original ontology structure.
I hope this was helpful,
Csongor
Paul Smith wrote:
> Thanks,
>
> perhaps I am not yet fully acquainted with DataMaster Plugin. The problem is
> that when I import instances from a MySQL table into a Protégé class X , it
> creates a new subclass Y, named after the table, and fill it with the
> instances. How to import instances directly in class X then?? but what is
> worse, class Y has an entire new set of attributes, named after the table
> columns, whereas I wanted the attributes of X be filled. In other words I need
> to map the table columns to the attributes of class X. How to do this?? Please
> relief my struggle…
>
> ..Paul
>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
More information about the protege-discussion
mailing list