diff --git a/src/fr/inrialpes/exmo/align/onto/HeavyLoadedOntology.java b/src/fr/inrialpes/exmo/align/onto/HeavyLoadedOntology.java index f750fe0a4637e2c06028a6309ca48c3638e0c5c2..a57dfbabad128e10f221b0cf2cffbaa47d79d325 100644 --- a/src/fr/inrialpes/exmo/align/onto/HeavyLoadedOntology.java +++ b/src/fr/inrialpes/exmo/align/onto/HeavyLoadedOntology.java @@ -47,8 +47,8 @@ public interface HeavyLoadedOntology<O> extends LoadedOntology<O> { /* Property methods */ public Set<Object> getSubProperties( Object p, int local, int asserted, int named ); public Set<Object> getSuperProperties( Object p, int local, int asserted, int named ); - public Set<Object> getRange( Object p, boolean asserted ); - public Set<Object> getDomain( Object p, boolean asserted ); + public Set<Object> getRange( Object p, int asserted ); + public Set<Object> getDomain( Object p, int asserted ); /* Individual methods */ public Set<Object> getClasses( Object i, int local, int asserted, int named ); diff --git a/src/fr/inrialpes/exmo/align/onto/LoadedOntology.java b/src/fr/inrialpes/exmo/align/onto/LoadedOntology.java index 6a690aa90d2e5d2e2e1aed209fe6e3487ef06fab..2c7b153ac2c323b353fb745d793dbb4d101ce739 100644 --- a/src/fr/inrialpes/exmo/align/onto/LoadedOntology.java +++ b/src/fr/inrialpes/exmo/align/onto/LoadedOntology.java @@ -52,11 +52,12 @@ public interface LoadedOntology<O> extends Ontology<O> { public Set<?> getDataProperties(); public Set<?> getIndividuals(); + public int nbEntities(); public int nbClasses(); public int nbProperties(); public int nbDataProperties(); public int nbObjectProperties(); - public int nbInstances(); + public int nbIndividuals(); public void unload(); } diff --git a/src/fr/inrialpes/exmo/align/onto/Ontology.java b/src/fr/inrialpes/exmo/align/onto/Ontology.java index b6faee037d26603ae1b7f4951c9dcd7c2f208180..e5197635d18882d9a6ec374bd71b9bdf0ef68e34 100644 --- a/src/fr/inrialpes/exmo/align/onto/Ontology.java +++ b/src/fr/inrialpes/exmo/align/onto/Ontology.java @@ -21,8 +21,6 @@ package fr.inrialpes.exmo.align.onto; import java.net.URI; -import java.util.Set; - public interface Ontology<O> { diff --git a/src/fr/inrialpes/exmo/align/onto/OntologyFactory.java b/src/fr/inrialpes/exmo/align/onto/OntologyFactory.java index 4548e3d937aab7e303a6c6ec2f62e0e8eb2daebb..f0e4e591918012f7746acd35991d4d72c53dfb49 100644 --- a/src/fr/inrialpes/exmo/align/onto/OntologyFactory.java +++ b/src/fr/inrialpes/exmo/align/onto/OntologyFactory.java @@ -43,7 +43,6 @@ public abstract class OntologyFactory { public static int MENTIONNED = 11; public static int ALL = 12; - //protected static OntologyFactory instance = null; protected static Hashtable<String,OntologyFactory> instances = null; private static String API_NAME="fr.inrialpes.exmo.align.onto.owlapi10.OWLAPIOntologyFactory"; diff --git a/src/fr/inrialpes/exmo/align/onto/jena25/JENAOntology.java b/src/fr/inrialpes/exmo/align/onto/jena25/JENAOntology.java index fedbb7f719e3fc504a2fed2c197c1caa97bb5da9..f68b6790be0a3516c3777a2803df3b8c991de5a2 100644 --- a/src/fr/inrialpes/exmo/align/onto/jena25/JENAOntology.java +++ b/src/fr/inrialpes/exmo/align/onto/jena25/JENAOntology.java @@ -178,6 +178,10 @@ public class JENAOntology extends BasicOntology<OntModel> implements LoadedOntol return o instanceof OntProperty; } + public int nbEntities() { + return this.getEntities().size(); + } + public int nbClasses() { return this.getClasses().size(); } @@ -186,7 +190,7 @@ public class JENAOntology extends BasicOntology<OntModel> implements LoadedOntol return this.getDataProperties().size(); } - public int nbInstances() { + public int nbIndividuals() { return this.getIndividuals().size(); } diff --git a/src/fr/inrialpes/exmo/align/onto/owlapi10/OWLAPIOntology.java b/src/fr/inrialpes/exmo/align/onto/owlapi10/OWLAPIOntology.java index f53a649f73657d77ba44011584cc98e9ae176f18..05af7d131224f6b9c1355b1a37e4a706339fdc25 100644 --- a/src/fr/inrialpes/exmo/align/onto/owlapi10/OWLAPIOntology.java +++ b/src/fr/inrialpes/exmo/align/onto/owlapi10/OWLAPIOntology.java @@ -306,6 +306,12 @@ public class OWLAPIOntology extends BasicOntology<OWLOntology> implements HeavyL } } + public int nbEntities() { + if ( nbentities != -1 ) return nbentities; + nbentities = nbClasses()+nbProperties()+nbIndividuals(); + return nbentities; + } + public int nbClasses() { if ( nbclasses != -1 ) return nbclasses; try { @@ -342,7 +348,7 @@ public class OWLAPIOntology extends BasicOntology<OWLOntology> implements HeavyL } } - public int nbInstances() { + public int nbIndividuals() { if ( nbindividuals != -1 ) return nbindividuals; try { nbindividuals = ((OWLOntology)onto).getIndividuals().size(); @@ -408,7 +414,7 @@ public class OWLAPIOntology extends BasicOntology<OWLOntology> implements HeavyL try { for ( Object ent : ((OWLClass)cl).getSuperClasses( getOntology() ) ){ if ( ent instanceof OWLRestriction ) - prop.add( ((OWLRestriction)cl).getProperty() ); + prop.add( ((OWLRestriction)ent).getProperty() ); } } catch (OWLException e) { e.printStackTrace(); } } else { @@ -474,7 +480,7 @@ public class OWLAPIOntology extends BasicOntology<OWLOntology> implements HeavyL } return supers; } - public Set<Object> getRange( Object p, boolean asserted ){ + public Set<Object> getRange( Object p, int asserted ){ Set resultSet = new HashSet(); try { for ( Object ent : ((OWLProperty)p).getRanges( getOntology() ) ){ @@ -487,7 +493,7 @@ public class OWLAPIOntology extends BasicOntology<OWLOntology> implements HeavyL } catch (OWLException ex) {}; return resultSet; } - public Set<Object> getDomain( Object p, boolean asserted ){ + public Set<Object> getDomain( Object p, int asserted ){ Set resultSet = new HashSet(); try { for ( Object ent : ((OWLProperty)p).getDomains( getOntology() ) ){