From: Pine L. <lx...@gm...> - 2011-06-26 19:24:41
|
Dear all, I just jump from Jena to OWLAPI and am wondering whether there is some classes and methods that can create the enumeration class in the ontology (something similar to the EnumeratedClass in Jena) so that the classes can have the "oneOf" tag? If so, could you please provide a simple example? Thank you so much! Best wishes, Pine |
From: Ignazio P. <ipa...@gm...> - 2011-06-26 19:50:10
|
2011/6/26 Pine Liu <lx...@gm...>: > Dear all, > I just jump from Jena to OWLAPI and am wondering whether there is some > classes and methods that can create the enumeration class in the ontology > (something similar to the EnumeratedClass in Jena) so that the classes can > have the "oneOf" tag? If so, could you please provide a simple example? OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() method to create such enumerations. HTH, I. > Thank you so much! > Best wishes, > Pine > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |
From: Pine L. <lx...@gm...> - 2011-06-26 21:51:38
|
Thank you very much for the information! I tried but still don't know how to create the enumeration. Could you please help me with a sample code for an enumeration such as this? <owl:Class rdf:ID="Color"> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#White"/> <owl:Thing rdf:about="#Rose"/> <owl:Thing rdf:about="#Red"/> </owl:oneOf> </owl:Class> Thank you so much! Best wishes, Pine On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano < ipa...@gm...> wrote: > 2011/6/26 Pine Liu <lx...@gm...>: > > Dear all, > > I just jump from Jena to OWLAPI and am wondering whether there is some > > classes and methods that can create the enumeration class in the ontology > > (something similar to the EnumeratedClass in Jena) so that the classes > can > > have the "oneOf" tag? If so, could you please provide a simple example? > > > OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() > method to create such enumerations. > HTH, > I. > > > Thank you so much! > > Best wishes, > > Pine > > > ------------------------------------------------------------------------------ > > All of the data generated in your IT infrastructure is seriously > valuable. > > Why? It contains a definitive record of application performance, security > > threats, fraudulent activity, and more. Splunk takes this data and makes > > sense of it. IT sense. And common sense. > > http://p.sf.net/sfu/splunk-d2d-c2 > > _______________________________________________ > > Owlapi-developer mailing list > > Owl...@li... > > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |
From: An C. T. <tca...@gm...> - 2011-06-27 01:34:14
Attachments:
abd.muse.massey.ac.nz.owl
Explanation_EquiClass_Lite.java
|
Hi all, Someone can help me with this: In my example, given an "OWLAxiom eq" is an EquivalentClass, the following segment of code: System.out.println("\n***" + eq.getAxiomType() + ":"); System.out.println("Annotation: " + eq.getAnnotations()); System.out.println(renderer.render(eq)); produces the following result: ***EquivalentClasses: Annotation: [] DurationAbnormality EquivalentTo Showering and ...... The annotation is always empty while I assigned annotation for this EquivalentClass before. However, it runs well for classes. I attached my ontology and java code for your checking. Cheers, An. |
From: Ignazio P. <ipa...@gm...> - 2011-06-27 09:06:25
|
2011/6/27 An C. Tran <tca...@gm...>: > Hi all, > > Someone can help me with this: > > In my example, given an "OWLAxiom eq" is an EquivalentClass, the following > segment of code: > System.out.println("\n***" + eq.getAxiomType() + ":"); > System.out.println("Annotation: " + eq.getAnnotations()); > System.out.println(renderer.render(eq)); > Hi, I tried your code (with some changes to remove calls to Pellet) with the latest OWL API and I get this output: Reading file file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology loaded ***EquivalentClasses: Annotation: [Annotation(rdfs:label "DurationAbnormality_Showering"^^xsd:string)] DurationAbnormality EquivalentTo Showering and (activityHasDuration some (Duration and ((hasDurationValue some double[> 15]) or (hasDurationValue some double[< 5])))) and (activityHasStarttime some Winter) ***EquivalentClasses: Annotation: [Annotation(rdfs:label "DurationAbnormality_Toileting"^^xsd:string)] DurationAbnormality EquivalentTo Toileting and (activityHasDuration some (Duration and (hasDurationValue some double[> 15]))) ***EquivalentClasses: Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) and (hasMonthValue some double[<= 8]) for this code: public class Explanation_EquiClass_Lite { private static final String file = "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; private static OWLObjectRenderer renderer = new ManchesterOWLSyntaxOWLObjectRendererImpl(); //new DLSyntaxObjectRenderer(); public static void main(String[] args) throws Exception { System.out.print("Reading file " + file + "..."); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntology(IRI.create(file)); OWLDataFactory factory = manager.getOWLDataFactory(); System.out.println("Ontology loaded"); OWLAnnotationProperty label = factory.getRDFSLabel(); for (OWLAxiom e : ontology.getAxioms()) { Set<OWLAnnotation> labels = e.getAnnotations(label); if (labels.size() > 0) { System.out.println("\n***" + e.getAxiomType() + ":"); System.out.println("Annotation: " + labels); System.out.println(renderer.render(e)); } } } } I assume you're using Pellet 2.2.2 and the OWL API which ships with it, which is from March 2010 IIRC. There might be bugs in that version of the OWL API, or Pellet might be returning the axioms stripped of the annotations. You can try Pellet with the latest release (3.2.3), if the bug is in the OWL API that should fix it. HTH, I. > produces the following result: > ***EquivalentClasses: > Annotation: [] > DurationAbnormality EquivalentTo Showering and ...... > > The annotation is always empty while I assigned annotation for this > EquivalentClass before. > However, it runs well for classes. > > I attached my ontology and java code for your checking. > > > Cheers, > An. > > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |
From: An C. T. <tca...@gm...> - 2011-06-28 00:19:42
|
Thank you so much for your kind help, Ignazio. I executed your code with both OWLAPI v3.2.3 and the one that is shipped with Pellet 2.2.2 and both them worked well. So, the problem should be a bug in Pellet that prevent returning the annotation of axioms? Do you have any idea about this problem? If we cannot fix that bug in Pellet, I think we can get a solution with the help of OWLAPI. Do you think so? Thank you. An. On 6/27/2011 9:06 PM, Ignazio Palmisano wrote: > 2011/6/27 An C. Tran<tca...@gm...>: >> Hi all, >> >> Someone can help me with this: >> >> In my example, given an "OWLAxiom eq" is an EquivalentClass, the following >> segment of code: >> System.out.println("\n***" + eq.getAxiomType() + ":"); >> System.out.println("Annotation: " + eq.getAnnotations()); >> System.out.println(renderer.render(eq)); >> > Hi, > I tried your code (with some changes to remove calls to Pellet) with > the latest OWL API and I get this output: > > Reading file file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology > loaded > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "DurationAbnormality_Showering"^^xsd:string)] > DurationAbnormality EquivalentTo Showering and (activityHasDuration some > (Duration and ((hasDurationValue some double[> 15]) or > (hasDurationValue some double[< 5])))) and (activityHasStarttime some > Winter) > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "DurationAbnormality_Toileting"^^xsd:string)] > DurationAbnormality EquivalentTo Toileting and (activityHasDuration some > (Duration and (hasDurationValue some double[> 15]))) > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] > Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) > and (hasMonthValue some double[<= 8]) > > > for this code: > > public class Explanation_EquiClass_Lite { > private static final String file = > "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; > private static OWLObjectRenderer renderer = new > ManchesterOWLSyntaxOWLObjectRendererImpl(); //new > DLSyntaxObjectRenderer(); > > public static void main(String[] args) throws Exception { > System.out.print("Reading file " + file + "..."); > OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); > OWLOntology ontology = manager.loadOntology(IRI.create(file)); > OWLDataFactory factory = manager.getOWLDataFactory(); > System.out.println("Ontology loaded"); > OWLAnnotationProperty label = factory.getRDFSLabel(); > for (OWLAxiom e : ontology.getAxioms()) { > Set<OWLAnnotation> labels = e.getAnnotations(label); > if (labels.size()> 0) { > System.out.println("\n***" + e.getAxiomType() + ":"); > System.out.println("Annotation: " + labels); > System.out.println(renderer.render(e)); > } > } > } > } > > > I assume you're using Pellet 2.2.2 and the OWL API which ships with > it, which is from March 2010 IIRC. There might be bugs in that version > of the OWL API, or Pellet might be returning the axioms stripped of > the annotations. You can try Pellet with the latest release (3.2.3), > if the bug is in the OWL API that should fix it. > HTH, > I. > >> produces the following result: >> ***EquivalentClasses: >> Annotation: [] >> DurationAbnormality EquivalentTo Showering and ...... >> >> The annotation is always empty while I assigned annotation for this >> EquivalentClass before. >> However, it runs well for classes. >> >> I attached my ontology and java code for your checking. >> >> >> Cheers, >> An. >> >> >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |
From: Ignazio P. <ipa...@gm...> - 2011-06-28 06:38:13
|
2011/6/28 An C. Tran <tca...@gm...>: > Thank you so much for your kind help, Ignazio. > > I executed your code with both OWLAPI v3.2.3 and the one that is shipped > with Pellet 2.2.2 and both them worked well. So, the problem should be a > bug in Pellet that prevent returning the annotation of axioms? Do you > have any idea about this problem? I wouldn't call it a bug. I believe the axioms you're obtaining in the explanation are not the very same objects that are in the ontology but are created on demand for the explanation (some explanation techniques can break the axioms into parts to make the explanation laconic), so they would not carry the annotations of the original axiom. It might happen that the axiom being used in the explanation is the same as the original axiom in the ontology, in which case the annotations appear to be lost. > If we cannot fix that bug in Pellet, I > think we can get a solution with the help of OWLAPI. Do you think so? You can try one simple workaround: - iterate over all axioms in the ontology - for each axiom A, call the getAxiomWithoutAnnotations() and put that into B - this will give you the axiom with annotations removed - in a map, put B -> A Then, take the axioms from the explanation and check whether the map contains them as keys; those which are in the map correspond to annotated axioms, and you can get the annotations from the value corresponding to that key (axiom equals() method is supposed to take into account the annotations). HTH, I. > > Thank you. > An. > > > On 6/27/2011 9:06 PM, Ignazio Palmisano wrote: >> 2011/6/27 An C. Tran<tca...@gm...>: >>> Hi all, >>> >>> Someone can help me with this: >>> >>> In my example, given an "OWLAxiom eq" is an EquivalentClass, the following >>> segment of code: >>> System.out.println("\n***" + eq.getAxiomType() + ":"); >>> System.out.println("Annotation: " + eq.getAnnotations()); >>> System.out.println(renderer.render(eq)); >>> >> Hi, >> I tried your code (with some changes to remove calls to Pellet) with >> the latest OWL API and I get this output: >> >> Reading file file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology >> loaded >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label "DurationAbnormality_Showering"^^xsd:string)] >> DurationAbnormality EquivalentTo Showering and (activityHasDuration some >> (Duration and ((hasDurationValue some double[> 15]) or >> (hasDurationValue some double[< 5])))) and (activityHasStarttime some >> Winter) >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label "DurationAbnormality_Toileting"^^xsd:string)] >> DurationAbnormality EquivalentTo Toileting and (activityHasDuration some >> (Duration and (hasDurationValue some double[> 15]))) >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] >> Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) >> and (hasMonthValue some double[<= 8]) >> >> >> for this code: >> >> public class Explanation_EquiClass_Lite { >> private static final String file = >> "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; >> private static OWLObjectRenderer renderer = new >> ManchesterOWLSyntaxOWLObjectRendererImpl(); //new >> DLSyntaxObjectRenderer(); >> >> public static void main(String[] args) throws Exception { >> System.out.print("Reading file " + file + "..."); >> OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); >> OWLOntology ontology = manager.loadOntology(IRI.create(file)); >> OWLDataFactory factory = manager.getOWLDataFactory(); >> System.out.println("Ontology loaded"); >> OWLAnnotationProperty label = factory.getRDFSLabel(); >> for (OWLAxiom e : ontology.getAxioms()) { >> Set<OWLAnnotation> labels = e.getAnnotations(label); >> if (labels.size()> 0) { >> System.out.println("\n***" + e.getAxiomType() + ":"); >> System.out.println("Annotation: " + labels); >> System.out.println(renderer.render(e)); >> } >> } >> } >> } >> >> >> I assume you're using Pellet 2.2.2 and the OWL API which ships with >> it, which is from March 2010 IIRC. There might be bugs in that version >> of the OWL API, or Pellet might be returning the axioms stripped of >> the annotations. You can try Pellet with the latest release (3.2.3), >> if the bug is in the OWL API that should fix it. >> HTH, >> I. >> >>> produces the following result: >>> ***EquivalentClasses: >>> Annotation: [] >>> DurationAbnormality EquivalentTo Showering and ...... >>> >>> The annotation is always empty while I assigned annotation for this >>> EquivalentClass before. >>> However, it runs well for classes. >>> >>> I attached my ontology and java code for your checking. >>> >>> >>> Cheers, >>> An. >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> All of the data generated in your IT infrastructure is seriously valuable. >>> Why? It contains a definitive record of application performance, security >>> threats, fraudulent activity, and more. Splunk takes this data and makes >>> sense of it. IT sense. And common sense. >>> http://p.sf.net/sfu/splunk-d2d-c2 >>> _______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>> >>> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > |
From: An C. T. <tca...@gm...> - 2011-06-28 13:23:04
|
Bravo, Ignazio! I don't know whether this is a bug or not but your idea works well. Thanks so much. An. On 28/06/11 6:38 PM, Ignazio Palmisano wrote: > 2011/6/28 An C. Tran<tca...@gm...>: >> Thank you so much for your kind help, Ignazio. >> >> I executed your code with both OWLAPI v3.2.3 and the one that is shipped >> with Pellet 2.2.2 and both them worked well. So, the problem should be a >> bug in Pellet that prevent returning the annotation of axioms? Do you >> have any idea about this problem? > I wouldn't call it a bug. I believe the axioms you're obtaining in the > explanation are not the very same objects that are in the ontology but > are created on demand for the explanation (some explanation techniques > can break the axioms into parts to make the explanation laconic), so > they would not carry the annotations of the original axiom. It might > happen that the axiom being used in the explanation is the same as the > original axiom in the ontology, in which case the annotations appear > to be lost. > >> If we cannot fix that bug in Pellet, I >> think we can get a solution with the help of OWLAPI. Do you think so? > You can try one simple workaround: > > - iterate over all axioms in the ontology > - for each axiom A, call the getAxiomWithoutAnnotations() and put that > into B - this will give you the axiom with annotations removed > - in a map, put B -> A > > Then, take the axioms from the explanation and check whether the map > contains them as keys; those which are in the map correspond to > annotated axioms, and you can get the annotations from the value > corresponding to that key (axiom equals() method is supposed to take > into account the annotations). > > HTH, > I. > > >> Thank you. >> An. >> >> >> On 6/27/2011 9:06 PM, Ignazio Palmisano wrote: >>> 2011/6/27 An C. Tran<tca...@gm...>: >>>> Hi all, >>>> >>>> Someone can help me with this: >>>> >>>> In my example, given an "OWLAxiom eq" is an EquivalentClass, the following >>>> segment of code: >>>> System.out.println("\n***" + eq.getAxiomType() + ":"); >>>> System.out.println("Annotation: " + eq.getAnnotations()); >>>> System.out.println(renderer.render(eq)); >>>> >>> Hi, >>> I tried your code (with some changes to remove calls to Pellet) with >>> the latest OWL API and I get this output: >>> >>> Reading file file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology >>> loaded >>> >>> ***EquivalentClasses: >>> Annotation: [Annotation(rdfs:label "DurationAbnormality_Showering"^^xsd:string)] >>> DurationAbnormality EquivalentTo Showering and (activityHasDuration some >>> (Duration and ((hasDurationValue some double[> 15]) or >>> (hasDurationValue some double[< 5])))) and (activityHasStarttime some >>> Winter) >>> >>> ***EquivalentClasses: >>> Annotation: [Annotation(rdfs:label "DurationAbnormality_Toileting"^^xsd:string)] >>> DurationAbnormality EquivalentTo Toileting and (activityHasDuration some >>> (Duration and (hasDurationValue some double[> 15]))) >>> >>> ***EquivalentClasses: >>> Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] >>> Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) >>> and (hasMonthValue some double[<= 8]) >>> >>> >>> for this code: >>> >>> public class Explanation_EquiClass_Lite { >>> private static final String file = >>> "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; >>> private static OWLObjectRenderer renderer = new >>> ManchesterOWLSyntaxOWLObjectRendererImpl(); //new >>> DLSyntaxObjectRenderer(); >>> >>> public static void main(String[] args) throws Exception { >>> System.out.print("Reading file " + file + "..."); >>> OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); >>> OWLOntology ontology = manager.loadOntology(IRI.create(file)); >>> OWLDataFactory factory = manager.getOWLDataFactory(); >>> System.out.println("Ontology loaded"); >>> OWLAnnotationProperty label = factory.getRDFSLabel(); >>> for (OWLAxiom e : ontology.getAxioms()) { >>> Set<OWLAnnotation> labels = e.getAnnotations(label); >>> if (labels.size()> 0) { >>> System.out.println("\n***" + e.getAxiomType() + ":"); >>> System.out.println("Annotation: " + labels); >>> System.out.println(renderer.render(e)); >>> } >>> } >>> } >>> } >>> >>> >>> I assume you're using Pellet 2.2.2 and the OWL API which ships with >>> it, which is from March 2010 IIRC. There might be bugs in that version >>> of the OWL API, or Pellet might be returning the axioms stripped of >>> the annotations. You can try Pellet with the latest release (3.2.3), >>> if the bug is in the OWL API that should fix it. >>> HTH, >>> I. >>> >>>> produces the following result: >>>> ***EquivalentClasses: >>>> Annotation: [] >>>> DurationAbnormality EquivalentTo Showering and ...... >>>> >>>> The annotation is always empty while I assigned annotation for this >>>> EquivalentClass before. >>>> However, it runs well for classes. >>>> >>>> I attached my ontology and java code for your checking. >>>> >>>> >>>> Cheers, >>>> An. >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> All of the data generated in your IT infrastructure is seriously valuable. >>>> Why? It contains a definitive record of application performance, security >>>> threats, fraudulent activity, and more. Splunk takes this data and makes >>>> sense of it. IT sense. And common sense. >>>> http://p.sf.net/sfu/splunk-d2d-c2 >>>> _______________________________________________ >>>> Owlapi-developer mailing list >>>> Owl...@li... >>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>> >>>> >>> ------------------------------------------------------------------------------ >>> All of the data generated in your IT infrastructure is seriously valuable. >>> Why? It contains a definitive record of application performance, security >>> threats, fraudulent activity, and more. Splunk takes this data and makes >>> sense of it. IT sense. And common sense. >>> http://p.sf.net/sfu/splunk-d2d-c2 >>> _______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |
From: Ignazio P. <ipa...@gm...> - 2011-06-27 06:25:23
|
2011/6/26 Pine Liu <lx...@gm...>: > Thank you very much for the information! I tried but still don't know how to > create the enumeration. Could you please help me with a sample code for an > enumeration such as this? > > <owl:Class rdf:ID="Color"> > <owl:oneOf rdf:parseType="Collection"> > <owl:Thing rdf:about="#White"/> > <owl:Thing rdf:about="#Rose"/> > <owl:Thing rdf:about="#Red"/> > </owl:oneOf> > </owl:Class> > Create the three individuals: OWLDataFactory f = manager.getOWLDataFactory(); OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); ... OWLClassExpression c=f.getOWLObjectOneOf(a, b...); I. > Thank you so much! > Best wishes, > Pine > On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano > <ipa...@gm...> wrote: >> >> 2011/6/26 Pine Liu <lx...@gm...>: >> > Dear all, >> > I just jump from Jena to OWLAPI and am wondering whether there is some >> > classes and methods that can create the enumeration class in the >> > ontology >> > (something similar to the EnumeratedClass in Jena) so that the classes >> > can >> > have the "oneOf" tag? If so, could you please provide a simple example? >> >> >> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() >> method to create such enumerations. >> HTH, >> I. >> >> > Thank you so much! >> > Best wishes, >> > Pine >> > >> > ------------------------------------------------------------------------------ >> > All of the data generated in your IT infrastructure is seriously >> > valuable. >> > Why? It contains a definitive record of application performance, >> > security >> > threats, fraudulent activity, and more. Splunk takes this data and makes >> > sense of it. IT sense. And common sense. >> > http://p.sf.net/sfu/splunk-d2d-c2 >> > _______________________________________________ >> > Owlapi-developer mailing list >> > Owl...@li... >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > >> > >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |
From: Pine L. <lx...@gm...> - 2011-06-27 13:51:53
|
Still need your help :) I am able to create the OWLObjectOneOf instance using this code. However, I still don't know how to link it to the new class "Color", as shown in the OWL file. Also, after I save the ontology, nether the added individuals or the oneOf instance is saved in the OWL file. Is there anything else I should do to create this enumeration? Thank you very much! Best wishes, Pine On Mon, Jun 27, 2011 at 2:25 AM, Ignazio Palmisano < ipa...@gm...> wrote: > 2011/6/26 Pine Liu <lx...@gm...>: > > Thank you very much for the information! I tried but still don't know how > to > > create the enumeration. Could you please help me with a sample code for > an > > enumeration such as this? > > > > <owl:Class rdf:ID="Color"> > > <owl:oneOf rdf:parseType="Collection"> > > <owl:Thing rdf:about="#White"/> > > <owl:Thing rdf:about="#Rose"/> > > <owl:Thing rdf:about="#Red"/> > > </owl:oneOf> > > </owl:Class> > > > > Create the three individuals: > > OWLDataFactory f = manager.getOWLDataFactory(); > OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); > ... > > OWLClassExpression c=f.getOWLObjectOneOf(a, b...); > > I. > > > Thank you so much! > > Best wishes, > > Pine > > On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano > > <ipa...@gm...> wrote: > >> > >> 2011/6/26 Pine Liu <lx...@gm...>: > >> > Dear all, > >> > I just jump from Jena to OWLAPI and am wondering whether there is some > >> > classes and methods that can create the enumeration class in the > >> > ontology > >> > (something similar to the EnumeratedClass in Jena) so that the classes > >> > can > >> > have the "oneOf" tag? If so, could you please provide a simple > example? > >> > >> > >> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() > >> method to create such enumerations. > >> HTH, > >> I. > >> > >> > Thank you so much! > >> > Best wishes, > >> > Pine > >> > > >> > > ------------------------------------------------------------------------------ > >> > All of the data generated in your IT infrastructure is seriously > >> > valuable. > >> > Why? It contains a definitive record of application performance, > >> > security > >> > threats, fraudulent activity, and more. Splunk takes this data and > makes > >> > sense of it. IT sense. And common sense. > >> > http://p.sf.net/sfu/splunk-d2d-c2 > >> > _______________________________________________ > >> > Owlapi-developer mailing list > >> > Owl...@li... > >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> > > >> > > >> > >> > >> > ------------------------------------------------------------------------------ > >> All of the data generated in your IT infrastructure is seriously > valuable. > >> Why? It contains a definitive record of application performance, > security > >> threats, fraudulent activity, and more. Splunk takes this data and makes > >> sense of it. IT sense. And common sense. > >> http://p.sf.net/sfu/splunk-d2d-c2 > >> _______________________________________________ > >> Owlapi-developer mailing list > >> Owl...@li... > >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > > ------------------------------------------------------------------------------ > > All of the data generated in your IT infrastructure is seriously > valuable. > > Why? It contains a definitive record of application performance, security > > threats, fraudulent activity, and more. Splunk takes this data and makes > > sense of it. IT sense. And common sense. > > http://p.sf.net/sfu/splunk-d2d-c2 > > _______________________________________________ > > Owlapi-developer mailing list > > Owl...@li... > > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > |
From: Ignazio P. <ipa...@gm...> - 2011-06-27 14:13:03
|
2011/6/27 Pine Liu <lx...@gm...>: > Still need your help :) > I am able to create the OWLObjectOneOf instance using this code. However, I > still don't know how to link it to the new class "Color", as shown in the > OWL file. Also, after I save the ontology, nether the added individuals or > the oneOf instance is saved in the OWL file. Is there anything else I should > do to create this enumeration? Thank you very much! Are you adding the axioms to the ontology, and then saving the ontology? (You may want to share the code that's not working as expected...) HTH, I. > Best wishes, > Pine > > On Mon, Jun 27, 2011 at 2:25 AM, Ignazio Palmisano > <ipa...@gm...> wrote: >> >> 2011/6/26 Pine Liu <lx...@gm...>: >> > Thank you very much for the information! I tried but still don't know >> > how to >> > create the enumeration. Could you please help me with a sample code for >> > an >> > enumeration such as this? >> > >> > <owl:Class rdf:ID="Color"> >> > <owl:oneOf rdf:parseType="Collection"> >> > <owl:Thing rdf:about="#White"/> >> > <owl:Thing rdf:about="#Rose"/> >> > <owl:Thing rdf:about="#Red"/> >> > </owl:oneOf> >> > </owl:Class> >> > >> >> Create the three individuals: >> >> OWLDataFactory f = manager.getOWLDataFactory(); >> OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); >> ... >> >> OWLClassExpression c=f.getOWLObjectOneOf(a, b...); >> >> I. >> >> > Thank you so much! >> > Best wishes, >> > Pine >> > On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano >> > <ipa...@gm...> wrote: >> >> >> >> 2011/6/26 Pine Liu <lx...@gm...>: >> >> > Dear all, >> >> > I just jump from Jena to OWLAPI and am wondering whether there is >> >> > some >> >> > classes and methods that can create the enumeration class in the >> >> > ontology >> >> > (something similar to the EnumeratedClass in Jena) so that the >> >> > classes >> >> > can >> >> > have the "oneOf" tag? If so, could you please provide a simple >> >> > example? >> >> >> >> >> >> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() >> >> method to create such enumerations. >> >> HTH, >> >> I. >> >> >> >> > Thank you so much! >> >> > Best wishes, >> >> > Pine >> >> > >> >> > >> >> > ------------------------------------------------------------------------------ >> >> > All of the data generated in your IT infrastructure is seriously >> >> > valuable. >> >> > Why? It contains a definitive record of application performance, >> >> > security >> >> > threats, fraudulent activity, and more. Splunk takes this data and >> >> > makes >> >> > sense of it. IT sense. And common sense. >> >> > http://p.sf.net/sfu/splunk-d2d-c2 >> >> > _______________________________________________ >> >> > Owlapi-developer mailing list >> >> > Owl...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> > >> >> > >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> All of the data generated in your IT infrastructure is seriously >> >> valuable. >> >> Why? It contains a definitive record of application performance, >> >> security >> >> threats, fraudulent activity, and more. Splunk takes this data and >> >> makes >> >> sense of it. IT sense. And common sense. >> >> http://p.sf.net/sfu/splunk-d2d-c2 >> >> _______________________________________________ >> >> Owlapi-developer mailing list >> >> Owl...@li... >> >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > >> > >> > ------------------------------------------------------------------------------ >> > All of the data generated in your IT infrastructure is seriously >> > valuable. >> > Why? It contains a definitive record of application performance, >> > security >> > threats, fraudulent activity, and more. Splunk takes this data and makes >> > sense of it. IT sense. And common sense. >> > http://p.sf.net/sfu/splunk-d2d-c2 >> > _______________________________________________ >> > Owlapi-developer mailing list >> > Owl...@li... >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > >> > >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |
From: Randy K. <rk...@sa...> - 2011-06-27 16:38:41
|
You need to add an EquivalentClasses Axiom to equate the Named OWL Class Color to the ObjectOneOf ClassExpression. To what you had before, add something like the following: OWLOntology ontology = ....; OWLClassExpression c = f.getOWLObjectOneOf( .... ); OWLClass colorClass = f.getOWLClass( IRI.create( "http://example.com/ex.owl#Color" ) ); OWLAxiom ax = f.getOWLEquivalentClasses( colorClass, c ); manager.applyChange( new AddAxiom( ontology, ax ) ); (Note: I'm just typing freehand into email message, so typos are possible) -- Randy Randy Kerber Sandpiper Software Long View International San Jose, California rk...@sa... On Jun 27, 2011, at 7:12 AM, Ignazio Palmisano wrote: > 2011/6/27 Pine Liu <lx...@gm...>: >> Still need your help :) >> I am able to create the OWLObjectOneOf instance using this code. However, I >> still don't know how to link it to the new class "Color", as shown in the >> OWL file. Also, after I save the ontology, nether the added individuals or >> the oneOf instance is saved in the OWL file. Is there anything else I should >> do to create this enumeration? Thank you very much! > > Are you adding the axioms to the ontology, and then saving the ontology? > (You may want to share the code that's not working as expected...) > HTH, > I. > >> Best wishes, >> Pine >> >> On Mon, Jun 27, 2011 at 2:25 AM, Ignazio Palmisano >> <ipa...@gm...> wrote: >>> >>> 2011/6/26 Pine Liu <lx...@gm...>: >>>> Thank you very much for the information! I tried but still don't know >>>> how to >>>> create the enumeration. Could you please help me with a sample code for >>>> an >>>> enumeration such as this? >>>> >>>> <owl:Class rdf:ID="Color"> >>>> <owl:oneOf rdf:parseType="Collection"> >>>> <owl:Thing rdf:about="#White"/> >>>> <owl:Thing rdf:about="#Rose"/> >>>> <owl:Thing rdf:about="#Red"/> >>>> </owl:oneOf> >>>> </owl:Class> >>>> >>> >>> Create the three individuals: >>> >>> OWLDataFactory f = manager.getOWLDataFactory(); >>> OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); >>> ... >>> >>> OWLClassExpression c=f.getOWLObjectOneOf(a, b...); >>> >>> I. >>> >>>> Thank you so much! >>>> Best wishes, >>>> Pine >>>> On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano >>>> <ipa...@gm...> wrote: >>>>> >>>>> 2011/6/26 Pine Liu <lx...@gm...>: >>>>>> Dear all, >>>>>> I just jump from Jena to OWLAPI and am wondering whether there is >>>>>> some >>>>>> classes and methods that can create the enumeration class in the >>>>>> ontology >>>>>> (something similar to the EnumeratedClass in Jena) so that the >>>>>> classes >>>>>> can >>>>>> have the "oneOf" tag? If so, could you please provide a simple >>>>>> example? >>>>> >>>>> >>>>> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() >>>>> method to create such enumerations. >>>>> HTH, >>>>> I. >>>>> >>>>>> Thank you so much! >>>>>> Best wishes, >>>>>> Pine >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> All of the data generated in your IT infrastructure is seriously >>>>>> valuable. >>>>>> Why? It contains a definitive record of application performance, >>>>>> security >>>>>> threats, fraudulent activity, and more. Splunk takes this data and >>>>>> makes >>>>>> sense of it. IT sense. And common sense. >>>>>> http://p.sf.net/sfu/splunk-d2d-c2 >>>>>> _______________________________________________ >>>>>> Owlapi-developer mailing list >>>>>> Owl...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> All of the data generated in your IT infrastructure is seriously >>>>> valuable. >>>>> Why? It contains a definitive record of application performance, >>>>> security >>>>> threats, fraudulent activity, and more. Splunk takes this data and >>>>> makes >>>>> sense of it. IT sense. And common sense. >>>>> http://p.sf.net/sfu/splunk-d2d-c2 >>>>> _______________________________________________ >>>>> Owlapi-developer mailing list >>>>> Owl...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> All of the data generated in your IT infrastructure is seriously >>>> valuable. >>>> Why? It contains a definitive record of application performance, >>>> security >>>> threats, fraudulent activity, and more. Splunk takes this data and makes >>>> sense of it. IT sense. And common sense. >>>> http://p.sf.net/sfu/splunk-d2d-c2 >>>> _______________________________________________ >>>> Owlapi-developer mailing list >>>> Owl...@li... >>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> All of the data generated in your IT infrastructure is seriously valuable. >>> Why? It contains a definitive record of application performance, security >>> threats, fraudulent activity, and more. Splunk takes this data and makes >>> sense of it. IT sense. And common sense. >>> http://p.sf.net/sfu/splunk-d2d-c2 >>> _______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |
From: Pine L. <lx...@gm...> - 2011-06-28 14:44:56
|
Hi Randy and Ignazio, Thank you very much for the information! I don't know how to use the axiom and I think that's the problem. I tried Randy's way and got this result: <owl:Class rdf:ID="Color"> <owl:equivalentClass> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#White"/> <owl:Thing rdf:about="#Rose"/> <owl:Thing rdf:about="#Red"/> </owl:oneOf> </owl:Class> </owl:equivalentClass> </owl:Class> Compared to the example generated using Jena, it is a little different (using Randy's approach, there seems to be one more class): <owl:Class rdf:ID="Color"> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#White"/> <owl:Thing rdf:about="#Rose"/> <owl:Thing rdf:about="#Red"/> </owl:oneOf> </owl:Class> Will they actually act the same? Is there a way to generate the same OWL as Jena did? Thank you so much! Best wishes, Pine On Mon, Jun 27, 2011 at 12:11 PM, Randy Kerber <rk...@sa...> wrote: > You need to add an EquivalentClasses Axiom to equate the Named OWL Class > Color to the ObjectOneOf ClassExpression. > > To what you had before, add something like the following: > > OWLOntology ontology = ....; > OWLClassExpression c = f.getOWLObjectOneOf( .... ); > > OWLClass colorClass = f.getOWLClass( IRI.create( " > http://example.com/ex.owl#Color" ) ); > OWLAxiom ax = f.getOWLEquivalentClasses( colorClass, c ); > manager.applyChange( new AddAxiom( ontology, ax ) ); > > (Note: I'm just typing freehand into email message, so typos are possible) > > > -- Randy > > Randy Kerber > Sandpiper Software > Long View International > San Jose, California > rk...@sa... > > > > > On Jun 27, 2011, at 7:12 AM, Ignazio Palmisano wrote: > > > 2011/6/27 Pine Liu <lx...@gm...>: > >> Still need your help :) > >> I am able to create the OWLObjectOneOf instance using this code. > However, I > >> still don't know how to link it to the new class "Color", as shown in > the > >> OWL file. Also, after I save the ontology, nether the added individuals > or > >> the oneOf instance is saved in the OWL file. Is there anything else I > should > >> do to create this enumeration? Thank you very much! > > > > Are you adding the axioms to the ontology, and then saving the ontology? > > (You may want to share the code that's not working as expected...) > > HTH, > > I. > > > >> Best wishes, > >> Pine > >> > >> On Mon, Jun 27, 2011 at 2:25 AM, Ignazio Palmisano > >> <ipa...@gm...> wrote: > >>> > >>> 2011/6/26 Pine Liu <lx...@gm...>: > >>>> Thank you very much for the information! I tried but still don't know > >>>> how to > >>>> create the enumeration. Could you please help me with a sample code > for > >>>> an > >>>> enumeration such as this? > >>>> > >>>> <owl:Class rdf:ID="Color"> > >>>> <owl:oneOf rdf:parseType="Collection"> > >>>> <owl:Thing rdf:about="#White"/> > >>>> <owl:Thing rdf:about="#Rose"/> > >>>> <owl:Thing rdf:about="#Red"/> > >>>> </owl:oneOf> > >>>> </owl:Class> > >>>> > >>> > >>> Create the three individuals: > >>> > >>> OWLDataFactory f = manager.getOWLDataFactory(); > >>> OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); > >>> ... > >>> > >>> OWLClassExpression c=f.getOWLObjectOneOf(a, b...); > >>> > >>> I. > >>> > >>>> Thank you so much! > >>>> Best wishes, > >>>> Pine > >>>> On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano > >>>> <ipa...@gm...> wrote: > >>>>> > >>>>> 2011/6/26 Pine Liu <lx...@gm...>: > >>>>>> Dear all, > >>>>>> I just jump from Jena to OWLAPI and am wondering whether there is > >>>>>> some > >>>>>> classes and methods that can create the enumeration class in the > >>>>>> ontology > >>>>>> (something similar to the EnumeratedClass in Jena) so that the > >>>>>> classes > >>>>>> can > >>>>>> have the "oneOf" tag? If so, could you please provide a simple > >>>>>> example? > >>>>> > >>>>> > >>>>> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() > >>>>> method to create such enumerations. > >>>>> HTH, > >>>>> I. > >>>>> > >>>>>> Thank you so much! > >>>>>> Best wishes, > >>>>>> Pine > >>>>>> > >>>>>> > >>>>>> > ------------------------------------------------------------------------------ > >>>>>> All of the data generated in your IT infrastructure is seriously > >>>>>> valuable. > >>>>>> Why? It contains a definitive record of application performance, > >>>>>> security > >>>>>> threats, fraudulent activity, and more. Splunk takes this data and > >>>>>> makes > >>>>>> sense of it. IT sense. And common sense. > >>>>>> http://p.sf.net/sfu/splunk-d2d-c2 > >>>>>> _______________________________________________ > >>>>>> Owlapi-developer mailing list > >>>>>> Owl...@li... > >>>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >>>>>> > >>>>>> > >>>>> > >>>>> > >>>>> > >>>>> > ------------------------------------------------------------------------------ > >>>>> All of the data generated in your IT infrastructure is seriously > >>>>> valuable. > >>>>> Why? It contains a definitive record of application performance, > >>>>> security > >>>>> threats, fraudulent activity, and more. Splunk takes this data and > >>>>> makes > >>>>> sense of it. IT sense. And common sense. > >>>>> http://p.sf.net/sfu/splunk-d2d-c2 > >>>>> _______________________________________________ > >>>>> Owlapi-developer mailing list > >>>>> Owl...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >>>> > >>>> > >>>> > ------------------------------------------------------------------------------ > >>>> All of the data generated in your IT infrastructure is seriously > >>>> valuable. > >>>> Why? It contains a definitive record of application performance, > >>>> security > >>>> threats, fraudulent activity, and more. Splunk takes this data and > makes > >>>> sense of it. IT sense. And common sense. > >>>> http://p.sf.net/sfu/splunk-d2d-c2 > >>>> _______________________________________________ > >>>> Owlapi-developer mailing list > >>>> Owl...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >>>> > >>>> > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> All of the data generated in your IT infrastructure is seriously > valuable. > >>> Why? It contains a definitive record of application performance, > security > >>> threats, fraudulent activity, and more. Splunk takes this data and > makes > >>> sense of it. IT sense. And common sense. > >>> http://p.sf.net/sfu/splunk-d2d-c2 > >>> _______________________________________________ > >>> Owlapi-developer mailing list > >>> Owl...@li... > >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> > >> > ------------------------------------------------------------------------------ > >> All of the data generated in your IT infrastructure is seriously > valuable. > >> Why? It contains a definitive record of application performance, > security > >> threats, fraudulent activity, and more. Splunk takes this data and makes > >> sense of it. IT sense. And common sense. > >> http://p.sf.net/sfu/splunk-d2d-c2 > >> _______________________________________________ > >> Owlapi-developer mailing list > >> Owl...@li... > >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> > >> > > > > > ------------------------------------------------------------------------------ > > All of the data generated in your IT infrastructure is seriously > valuable. > > Why? It contains a definitive record of application performance, security > > threats, fraudulent activity, and more. Splunk takes this data and makes > > sense of it. IT sense. And common sense. > > http://p.sf.net/sfu/splunk-d2d-c2 > > _______________________________________________ > > Owlapi-developer mailing list > > Owl...@li... > > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > |
From: Ignazio P. <ipa...@gm...> - 2011-06-28 22:23:56
|
2011/6/28 Pine Liu <lx...@gm...>: > Hi Randy and Ignazio, > Thank you very much for the information! I don't know how to use the axiom > and I think that's the problem. I tried Randy's way and got this result: > > <owl:Class rdf:ID="Color"> > > <owl:equivalentClass> > > <owl:Class> > <owl:oneOf rdf:parseType="Collection"> > <owl:Thing rdf:about="#White"/> > <owl:Thing rdf:about="#Rose"/> > <owl:Thing rdf:about="#Red"/> > </owl:oneOf> > > </owl:Class> > > </owl:equivalentClass> > > </owl:Class> > > Compared to the example generated using Jena, it is a little different > (using Randy's approach, there seems to be one more class): > > <owl:Class rdf:ID="Color"> > <owl:oneOf rdf:parseType="Collection"> > <owl:Thing rdf:about="#White"/> > <owl:Thing rdf:about="#Rose"/> > <owl:Thing rdf:about="#Red"/> > </owl:oneOf> > </owl:Class> They look the same except this second one does not adhere strictly to the latest specs. oneOf is supposed to be attached to a blank node, i.e., an anonymous class, and this one isn't. The previous piece of OWL is more specs conformant. HTH, I. > > Will they actually act the same? Is there a way to generate the same OWL as > Jena did? Thank you so much! > Best wishes, > Pine > > > On Mon, Jun 27, 2011 at 12:11 PM, Randy Kerber <rk...@sa...> wrote: >> >> You need to add an EquivalentClasses Axiom to equate the Named OWL Class >> Color to the ObjectOneOf ClassExpression. >> >> To what you had before, add something like the following: >> >> OWLOntology ontology = ....; >> OWLClassExpression c = f.getOWLObjectOneOf( .... ); >> >> OWLClass colorClass = f.getOWLClass( IRI.create( >> "http://example.com/ex.owl#Color" ) ); >> OWLAxiom ax = f.getOWLEquivalentClasses( colorClass, c ); >> manager.applyChange( new AddAxiom( ontology, ax ) ); >> >> (Note: I'm just typing freehand into email message, so typos are possible) >> >> >> -- Randy >> >> Randy Kerber >> Sandpiper Software >> Long View International >> San Jose, California >> rk...@sa... >> >> >> >> >> On Jun 27, 2011, at 7:12 AM, Ignazio Palmisano wrote: >> >> > 2011/6/27 Pine Liu <lx...@gm...>: >> >> Still need your help :) >> >> I am able to create the OWLObjectOneOf instance using this code. >> >> However, I >> >> still don't know how to link it to the new class "Color", as shown in >> >> the >> >> OWL file. Also, after I save the ontology, nether the added individuals >> >> or >> >> the oneOf instance is saved in the OWL file. Is there anything else I >> >> should >> >> do to create this enumeration? Thank you very much! >> > >> > Are you adding the axioms to the ontology, and then saving the ontology? >> > (You may want to share the code that's not working as expected...) >> > HTH, >> > I. >> > >> >> Best wishes, >> >> Pine >> >> >> >> On Mon, Jun 27, 2011 at 2:25 AM, Ignazio Palmisano >> >> <ipa...@gm...> wrote: >> >>> >> >>> 2011/6/26 Pine Liu <lx...@gm...>: >> >>>> Thank you very much for the information! I tried but still don't know >> >>>> how to >> >>>> create the enumeration. Could you please help me with a sample code >> >>>> for >> >>>> an >> >>>> enumeration such as this? >> >>>> >> >>>> <owl:Class rdf:ID="Color"> >> >>>> <owl:oneOf rdf:parseType="Collection"> >> >>>> <owl:Thing rdf:about="#White"/> >> >>>> <owl:Thing rdf:about="#Rose"/> >> >>>> <owl:Thing rdf:about="#Red"/> >> >>>> </owl:oneOf> >> >>>> </owl:Class> >> >>>> >> >>> >> >>> Create the three individuals: >> >>> >> >>> OWLDataFactory f = manager.getOWLDataFactory(); >> >>> OWLNamedIndividual a = f.getOWLNamedIndividual(IRI.create(...White)); >> >>> ... >> >>> >> >>> OWLClassExpression c=f.getOWLObjectOneOf(a, b...); >> >>> >> >>> I. >> >>> >> >>>> Thank you so much! >> >>>> Best wishes, >> >>>> Pine >> >>>> On Sun, Jun 26, 2011 at 3:50 PM, Ignazio Palmisano >> >>>> <ipa...@gm...> wrote: >> >>>>> >> >>>>> 2011/6/26 Pine Liu <lx...@gm...>: >> >>>>>> Dear all, >> >>>>>> I just jump from Jena to OWLAPI and am wondering whether there is >> >>>>>> some >> >>>>>> classes and methods that can create the enumeration class in the >> >>>>>> ontology >> >>>>>> (something similar to the EnumeratedClass in Jena) so that the >> >>>>>> classes >> >>>>>> can >> >>>>>> have the "oneOf" tag? If so, could you please provide a simple >> >>>>>> example? >> >>>>> >> >>>>> >> >>>>> OWLDataFactory has a getOWLDataOneOf() and a getOWLObjectOneOf() >> >>>>> method to create such enumerations. >> >>>>> HTH, >> >>>>> I. >> >>>>> >> >>>>>> Thank you so much! >> >>>>>> Best wishes, >> >>>>>> Pine >> >>>>>> >> >>>>>> >> >>>>>> >> >>>>>> ------------------------------------------------------------------------------ >> >>>>>> All of the data generated in your IT infrastructure is seriously >> >>>>>> valuable. >> >>>>>> Why? It contains a definitive record of application performance, >> >>>>>> security >> >>>>>> threats, fraudulent activity, and more. Splunk takes this data and >> >>>>>> makes >> >>>>>> sense of it. IT sense. And common sense. >> >>>>>> http://p.sf.net/sfu/splunk-d2d-c2 >> >>>>>> _______________________________________________ >> >>>>>> Owlapi-developer mailing list >> >>>>>> Owl...@li... >> >>>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >>>>>> >> >>>>>> >> >>>>> >> >>>>> >> >>>>> >> >>>>> >> >>>>> ------------------------------------------------------------------------------ >> >>>>> All of the data generated in your IT infrastructure is seriously >> >>>>> valuable. >> >>>>> Why? It contains a definitive record of application performance, >> >>>>> security >> >>>>> threats, fraudulent activity, and more. Splunk takes this data and >> >>>>> makes >> >>>>> sense of it. IT sense. And common sense. >> >>>>> http://p.sf.net/sfu/splunk-d2d-c2 >> >>>>> _______________________________________________ >> >>>>> Owlapi-developer mailing list >> >>>>> Owl...@li... >> >>>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >>>> >> >>>> >> >>>> >> >>>> ------------------------------------------------------------------------------ >> >>>> All of the data generated in your IT infrastructure is seriously >> >>>> valuable. >> >>>> Why? It contains a definitive record of application performance, >> >>>> security >> >>>> threats, fraudulent activity, and more. Splunk takes this data and >> >>>> makes >> >>>> sense of it. IT sense. And common sense. >> >>>> http://p.sf.net/sfu/splunk-d2d-c2 >> >>>> _______________________________________________ >> >>>> Owlapi-developer mailing list >> >>>> Owl...@li... >> >>>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >>>> >> >>>> >> >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >> >>> All of the data generated in your IT infrastructure is seriously >> >>> valuable. >> >>> Why? It contains a definitive record of application performance, >> >>> security >> >>> threats, fraudulent activity, and more. Splunk takes this data and >> >>> makes >> >>> sense of it. IT sense. And common sense. >> >>> http://p.sf.net/sfu/splunk-d2d-c2 >> >>> _______________________________________________ >> >>> Owlapi-developer mailing list >> >>> Owl...@li... >> >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> All of the data generated in your IT infrastructure is seriously >> >> valuable. >> >> Why? It contains a definitive record of application performance, >> >> security >> >> threats, fraudulent activity, and more. Splunk takes this data and >> >> makes >> >> sense of it. IT sense. And common sense. >> >> http://p.sf.net/sfu/splunk-d2d-c2 >> >> _______________________________________________ >> >> Owlapi-developer mailing list >> >> Owl...@li... >> >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> >> >> > >> > >> > ------------------------------------------------------------------------------ >> > All of the data generated in your IT infrastructure is seriously >> > valuable. >> > Why? It contains a definitive record of application performance, >> > security >> > threats, fraudulent activity, and more. Splunk takes this data and makes >> > sense of it. IT sense. And common sense. >> > http://p.sf.net/sfu/splunk-d2d-c2 >> > _______________________________________________ >> > Owlapi-developer mailing list >> > Owl...@li... >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |
From: An C. T. <tca...@gm...> - 2011-06-29 01:00:39
Attachments:
test.annotation.owl
|
Hi Ignazio, Your code work fine with the previous Ontology but it does not work for attached ontology. Would you like to help me with this. I am creating a simpler ontology for testing. Unfortunately, no annotation comes along with axiom for which the annotations was assigned but they appeared as separate axioms. Thanks, An. On 6/27/2011 9:06 PM, Ignazio Palmisano wrote: > 2011/6/27 An C. Tran<tca...@gm...>: >> Hi all, >> >> Someone can help me with this: >> >> In my example, given an "OWLAxiom eq" is an EquivalentClass, the following >> segment of code: >> System.out.println("\n***" + eq.getAxiomType() + ":"); >> System.out.println("Annotation: " + eq.getAnnotations()); >> System.out.println(renderer.render(eq)); >> > Hi, > I tried your code (with some changes to remove calls to Pellet) with > the latest OWL API and I get this output: > > Reading file file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology > loaded > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "DurationAbnormality_Showering"^^xsd:string)] > DurationAbnormality EquivalentTo Showering and (activityHasDuration some > (Duration and ((hasDurationValue some double[> 15]) or > (hasDurationValue some double[< 5])))) and (activityHasStarttime some > Winter) > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "DurationAbnormality_Toileting"^^xsd:string)] > DurationAbnormality EquivalentTo Toileting and (activityHasDuration some > (Duration and (hasDurationValue some double[> 15]))) > > ***EquivalentClasses: > Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] > Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) > and (hasMonthValue some double[<= 8]) > > > for this code: > > public class Explanation_EquiClass_Lite { > private static final String file = > "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; > private static OWLObjectRenderer renderer = new > ManchesterOWLSyntaxOWLObjectRendererImpl(); //new > DLSyntaxObjectRenderer(); > > public static void main(String[] args) throws Exception { > System.out.print("Reading file " + file + "..."); > OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); > OWLOntology ontology = manager.loadOntology(IRI.create(file)); > OWLDataFactory factory = manager.getOWLDataFactory(); > System.out.println("Ontology loaded"); > OWLAnnotationProperty label = factory.getRDFSLabel(); > for (OWLAxiom e : ontology.getAxioms()) { > Set<OWLAnnotation> labels = e.getAnnotations(label); > if (labels.size()> 0) { > System.out.println("\n***" + e.getAxiomType() + ":"); > System.out.println("Annotation: " + labels); > System.out.println(renderer.render(e)); > } > } > } > } > > > I assume you're using Pellet 2.2.2 and the OWL API which ships with > it, which is from March 2010 IIRC. There might be bugs in that version > of the OWL API, or Pellet might be returning the axioms stripped of > the annotations. You can try Pellet with the latest release (3.2.3), > if the bug is in the OWL API that should fix it. > HTH, > I. > >> produces the following result: >> ***EquivalentClasses: >> Annotation: [] >> DurationAbnormality EquivalentTo Showering and ...... >> >> The annotation is always empty while I assigned annotation for this >> EquivalentClass before. >> However, it runs well for classes. >> >> I attached my ontology and java code for your checking. >> >> >> Cheers, >> An. >> >> >> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer |
From: Ignazio P. <ipa...@gm...> - 2011-06-29 07:26:59
|
2011/6/29 An C. Tran <tca...@gm...>: > Hi Ignazio, > > Your code work fine with the previous Ontology but it does not work for > attached ontology. > Would you like to help me with this. I am creating a simpler ontology for > testing. > Unfortunately, no annotation comes along with axiom for which the > annotations was assigned but > they appeared as separate axioms. All the labels I can see are attached to classes not to axioms - that's probably why. HTH, I. > > Thanks, > An. > > On 6/27/2011 9:06 PM, Ignazio Palmisano wrote: >> >> 2011/6/27 An C. Tran<tca...@gm...>: >>> >>> Hi all, >>> >>> Someone can help me with this: >>> >>> In my example, given an "OWLAxiom eq" is an EquivalentClass, the >>> following >>> segment of code: >>> System.out.println("\n***" + eq.getAxiomType() + ":"); >>> System.out.println("Annotation: " + eq.getAnnotations()); >>> System.out.println(renderer.render(eq)); >>> >> Hi, >> I tried your code (with some changes to remove calls to Pellet) with >> the latest OWL API and I get this output: >> >> Reading file >> file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl...Ontology >> loaded >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label >> "DurationAbnormality_Showering"^^xsd:string)] >> DurationAbnormality EquivalentTo Showering and (activityHasDuration some >> (Duration and ((hasDurationValue some double[> 15]) or >> (hasDurationValue some double[< 5])))) and (activityHasStarttime some >> Winter) >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label >> "DurationAbnormality_Toileting"^^xsd:string)] >> DurationAbnormality EquivalentTo Toileting and (activityHasDuration some >> (Duration and (hasDurationValue some double[> 15]))) >> >> ***EquivalentClasses: >> Annotation: [Annotation(rdfs:label "EquivalentWinter_Ann")] >> Winter EquivalentTo Timepoint and (hasMonthValue some double[>= 5]) >> and (hasMonthValue some double[<= 8]) >> >> >> for this code: >> >> public class Explanation_EquiClass_Lite { >> private static final String file = >> "file:///Users/ignazio/Downloads/abd.muse.massey.ac.nz.owl"; >> private static OWLObjectRenderer renderer = new >> ManchesterOWLSyntaxOWLObjectRendererImpl(); //new >> DLSyntaxObjectRenderer(); >> >> public static void main(String[] args) throws Exception { >> System.out.print("Reading file " + file + "..."); >> OWLOntologyManager manager = >> OWLManager.createOWLOntologyManager(); >> OWLOntology ontology = >> manager.loadOntology(IRI.create(file)); >> OWLDataFactory factory = manager.getOWLDataFactory(); >> System.out.println("Ontology loaded"); >> OWLAnnotationProperty label = factory.getRDFSLabel(); >> for (OWLAxiom e : ontology.getAxioms()) { >> Set<OWLAnnotation> labels = >> e.getAnnotations(label); >> if (labels.size()> 0) { >> System.out.println("\n***" + >> e.getAxiomType() + ":"); >> System.out.println("Annotation: " + >> labels); >> System.out.println(renderer.render(e)); >> } >> } >> } >> } >> >> >> I assume you're using Pellet 2.2.2 and the OWL API which ships with >> it, which is from March 2010 IIRC. There might be bugs in that version >> of the OWL API, or Pellet might be returning the axioms stripped of >> the annotations. You can try Pellet with the latest release (3.2.3), >> if the bug is in the OWL API that should fix it. >> HTH, >> I. >> >>> produces the following result: >>> ***EquivalentClasses: >>> Annotation: [] >>> DurationAbnormality EquivalentTo Showering and ...... >>> >>> The annotation is always empty while I assigned annotation for this >>> EquivalentClass before. >>> However, it runs well for classes. >>> >>> I attached my ontology and java code for your checking. >>> >>> >>> Cheers, >>> An. >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> All of the data generated in your IT infrastructure is seriously >>> valuable. >>> Why? It contains a definitive record of application performance, security >>> threats, fraudulent activity, and more. Splunk takes this data and makes >>> sense of it. IT sense. And common sense. >>> http://p.sf.net/sfu/splunk-d2d-c2 >>> _______________________________________________ >>> Owlapi-developer mailing list >>> Owl...@li... >>> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >>> >>> >> >> ------------------------------------------------------------------------------ >> All of the data generated in your IT infrastructure is seriously valuable. >> Why? It contains a definitive record of application performance, security >> threats, fraudulent activity, and more. Splunk takes this data and makes >> sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-d2d-c2 >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |