Search Mailing List Archives
[protege-owl] Reg Seeting Allowed values for Data Type Property and Saving to a file
raghav.nprasad at gmail.com
Tue Mar 31 01:24:57 PDT 2009
I am working on Ontology Merging.i am facing few problems when setting the
allowed values for a data type property.Here i am trying to copy a property
from one owl file to another.The process i am following is create a new
property in the target owlmodel.Set the Range and allowed values same as
present in source owl model.
OWLDatatypeProperty Property = tomod.createOWLDatatypeProperty(st);
OWLDataRange range=(OWLDataRange) owlmod.getRDFProperty(st).getRange();
Here tomod is the target OWLModel and owlmod is the from OWLmodel.If i use
Sys.out.println and check Property.getvalues() its printing the values
set.But i save the file and if i open in Protege and check the Properties
tab and DataType property.For the newly created property there is no
alllowed values.Nothing is present.
Please let me know how can i set the allowed values for a datatype property.
My second question is reg saving an OWL file.
I am reading an OWL file by :
File file = new File("D:\\tomo.owl");
FileInputStream tin = new FileInputStream(file);
OWLModel toModel = ProtegeOWL.createJenaOWLModelFromInputStream(tin);
String fileName = "new.owl";
Collection errors = new ArrayList();
((JenaOWLModel) toModel).save(new File(fileName).toURI(),
System.out.println("File saved with " + errors.size() + " errors.");
The file is getting saved.But the format is different.Its not the same as
Protege creates.I am not able to read the file again after saving it.
Please let me know how to save the file ,so that it can be read again.File
format shud be preserved as the original one.But with new addition.
Thanks and Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the protege-owl