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-discussion] owldatatypeproperty

Timothy Redmond tredmond at stanford.edu
Tue Jan 24 15:25:27 PST 2012


I haven't yet looked at this carefully but it looks approximately 
right.  But did you remember to save the ontology at the end?

-Timothy



On 1/23/12 9:35 AM, Fahd Amjad wrote:
> Hi,
>
> I am using protege-owl-api to programatically populate my owl ontology 
> with individuals and then assigning data values to the added 
> individuals. I can populate the ontology with individual with i am 
> having problems in assigning RDFProperty values to the 
> addPropertyValue method. Can any one help me. The snippet below loads 
> the ontology , loads the individual s from excel and populates then in 
> Production-Schedule class and in the end assigns datatype values to 
> the newly populted individuals(here i am have deficulties)
>
>
> Reader inputFileForOntologyCore = new InputStreamReader(new 
> FileInputStream("C:/Users/saturn/Desktop/Ontology TEST 
> Folder/OntologyCore1.owl"));
>
> JenaOWLModel loadedOntologyCore = ProtegeOWL.createJenaOWLModel();
>
> //CREATE ONTOLOGY MANAGER
>
>             RepositoryManager manager = 
> loadedOntologyCore.getRepositoryManager();
>
>             File systemontologyFileFolder= new File("C:\\Program 
> Files\\Protege_3.4.4\\plugins\\edu.stanford.smi.protegex.owl");
>
>             LocalFolderRepository systemRepository = new 
> LocalFolderRepository(systemontologyFileFolder);
>
>             manager.addGlobalRepository(systemRepository);
>
>             loadedOntologyCore.load(inputFileForOntologyCore, 
> FileUtils.langXMLAbbrev);
>
>             System.out.println("OntologyCore Loaded");
>
> //    Input to the individuals of the class Production Schedule and 
> corresponding assignment of data-type properties.
>
> OWLNamedClass productionSchedule = 
> (loadedOntologyCore).getOWLNamedClass("Production_Schedule");
>
> OWLDatatypeProperty productionScheduleID = 
> (loadedOntologyCore).getOWLDatatypeProperty("has_Production_Schedule_ID");
>
> OWLDatatypeProperty productSegmentID = 
> (loadedOntologyCore).getOWLDatatypeProperty("has_Product_Segment_ID");
>
>
> for (int i=0; i<sheet.getRows()-1; i++){
>
>             //GETTING THE VALUES OF THE CELL FROM EXCEL WORKSHEET AND 
> ASSIGNING THEM TO VARIABLES
>
>             Cell cellProductionScheduleName = sheet.getCell(0, i+1);
>             Cell cellProductionScheduleID = sheet.getCell(1,i+1);
>             Cell cellProductSegmentID = sheet.getCell(2, i+1);
>             Cell cellProductInformationDemandDate = sheet.getCell(3,i+1);
>
>
>                     //CONVERTING THE CELL VALUES TO CORRESPONDING DATA 
> TYPES
>
>                     //CONVERTING INTO STRING
>
>                     String productionScheduleinstance = 
> cellProductionScheduleName.getContents();
>
> *//CONVERTING INTO INTEGER
>
>             NumberCell ProdSchID1=(NumberCell)cellProductionScheduleID;
>
>             Object ProdSchID =  (int) ProdSchID1.getValue();
>
>             NumberCell ProdSegID1= (NumberCell)cellProductSegmentID;
>
>             Object ProdSegID = (int) ProdSegID1.getValue();
>
>                     //CREATING INSTANCE IN ONTOLOGY
>
>                     
> productionSchedule.createOWLIndividual(productionScheduleinstance);
>
>                     
> productionSchedule.addPropertyValue((RDFProperty)(productionScheduleID),ProdSchID);
>
>                     
> productionSchedule.addPropertyValue((RDFProperty)(productionScheduleID),ProdSegID);*
>
> Fahd Amjad
> LGIPM Metz
> Université Paul Verlaine
> Tél: 00(33)-0611811038
>
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20120124/b99ea3cd/attachment-0001.html>


More information about the protege-discussion mailing list