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] domain (union of classes)

Timothy Redmond tredmond at
Sun Aug 3 17:44:04 PDT 2008

I think that your problem is your interpretation of

> As a result, the domain of each DP with a unionOf classes is  
> something like that:
> <rdfs:domain rdf:nodeID="A0"/>

Without more information it is not clear whether the domain wrote out  
as a union or not.  My suspicion is  that if you look for more  
statements about the resource with nodeID "A0" you will see the union  

As a test here I wrote the code

     public static void main(String[] args) throws  
OntologyLoadException, IOException {
         OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
         OWLNamedClass a = owlModel.createOWLNamedClass("A");
         OWLNamedClass b = owlModel.createOWLNamedClass("B");
         OWLDatatypeProperty p =  

         PrintWriter writer = new PrintWriter(System.out);
         OWLModelWriter modelWriter = new OWLModelWriter(owlModel,

and got the output

<rdf:RDF xmlns=""
     <owl:Ontology rdf:about=""/>
     <owl:Class rdf:ID="A"/>
     <owl:DatatypeProperty rdf:ID="p">
                 <owl:unionOf rdf:parseType="Collection">
                     <owl:Class rdf:about="#A"/>
                     <owl:Class rdf:about="#B"/>
     <owl:Class rdf:ID="B"/>


On Jul 30, 2008, at 4:53 PM, Agustina Buccella wrote:

> Hello, I am creating a new ontology based on two defined ontologies  
> (A1, A2)
> Both ontologies are OWL-DL, so unions in the domains and ranges are  
> possible... I have to get all classes and properties of ontology A1  
> and put them in some specific place in the ontology A2. So, I  
> firstly get the OWLNamedClasses of A1 (and create them in  A2) and I  
> secondly try to obtain all datatype properties and create them again  
> in A2.
> The problem is when the domain of the datatype properties (DP) are  
> unions.... I made a lot of proofs but I cant find the way to do  
> so... Here is my code:
>      while  (c.hasNext()){
>             //I get the classes...
>             String slaclase= (String);
>             OWLNamedClass laclase =  
> userModel.getOWLNamedClass(slaclase);
>             //I get the properties of the classes
>              aproperty =  
> getProperties(laclase.getUnionDomainProperties());
>             for (Iterator dp = aproperty.iterator(); dp.hasNext();){
>                 adp = (OWLDatatypeProperty);
>                 //when the domain is an UnionClass
>                 if (adp.getDomain(true) instanceof OWLUnionClass){
>                 //creating the property without domain and range...
>                 anewdp =  
> newModel.createOWLDatatypeProperty(adp.getBrowserText());
>                 //creating a collection with the union of classes
>                 Collection union= adp.getUnionDomain(false);
>                 for (Iterator j = union.iterator(); j.hasNext();){
>                             OWLNamedClass undominio =  
> (OWLNamedClass);
>                             //here is where I want to add each class  
> of the domain as domain of "anewdp"
> anewdp 
> .addUnionDomainClass 
> (newModel.getOWLNamedClass(undominio.getBrowserText()));
>                         }
>                         anewdp.setRange(adp.getRange());
>                 }
>         }
> As a result, the domain of each DP with a unionOf classes is  
> something like that:
> <rdfs:domain rdf:nodeID="A0"/>
> Am I using an incorrect method?
> Thanks
> Agustina
> ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing:

More information about the protege-owl mailing list