Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Reg Seeting Allowed values for Data Type Property and Saving to a file

RAGHAVENDRA PRASAD 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);
Property.setRange(owlmod.getOWLDatatypeProperty(st).getRangeDatatype());
OWLDataRange range=(OWLDataRange) owlmod.getRDFProperty(st).getRange();
Collection cls=range.getOneOfValues();
Property.getAllowedValues();
Property.setValues(cls);

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);

Saving by:
     String fileName = "new.owl";
     Collection errors = new ArrayList();
     ((JenaOWLModel) toModel).save(new File(fileName).toURI(),
FileUtils.langXMLAbbrev, errors);
     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,
Raghav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20090331/fa780835/attachment.html>


More information about the protege-owl mailing list