public static boolean isMaxCardinalityQRestriction( Node node, EnhGraph eg ) { // node will support being a QualifiedRestriction facet if it has rdf:type owl:Restriction or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, MaxCardinalityQRestriction.class ); }
/** * {@inheritDoc} */ @Override public void setIgnoreImports(boolean ignoreImports) { model.getDocumentManager().setProcessImports( !ignoreImports ); }
/** * <p>Set the URI of the ontology to use for models that conform to * this specification.</p> * @param languageURI The new language URI * @exception OntologyException if the URI does not map to a known language profile */ public void setLanguage( String languageURI ) { m_languageURI = languageURI; m_profile = ProfileRegistry.getInstance().getProfile( m_languageURI ); if (m_profile == null) { throw new OntologyException( "Could not determine an ontology language profile for URI " + m_languageURI ); } }
public OntologyHandler() { OntDocumentManager mgr = new OntDocumentManager(); mgr.setProcessImports(false); OntModelSpec s = new OntModelSpec( OntModelSpec.OWL_MEM ); s.setDocumentManager( mgr ); ontModel = ModelFactory.createOntologyModel(s); ontModel.setStrictMode(false); }
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an TransitiveProperty facet if it has rdf:type owl:TransitiveProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, TransitiveProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an DatatypeProperty facet if it has rdf:type owl:DatatypeProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, DatatypeProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being a CardinalityRestriction facet if it has rdf:type owl:Restriction or equivalent // and the combination of owl:onProperty and owl:cardinality (or equivalents) Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, CardinalityRestriction.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an AnnotationProperty facet if it has rdf:type owl:AnnotationProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, AnnotationProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an ObjectProperty facet if it has rdf:type owl:ObjectProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, ObjectProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an OntProperty facet if it has rdf:type owl:Property or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, OntProperty.class ); } };
public static boolean isMinCardinalityQRestriction( Node node, EnhGraph eg ) { // node will support being a QualifiedRestriction facet if it has rdf:type owl:Restriction or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, MinCardinalityQRestriction.class ); }
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an InverseFunctionalProperty facet if it has rdf:type owl:InverseFunctionalProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, InverseFunctionalProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an Individual facet if it is a URI node or bNode Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, Individual.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being a HasValueRestriction facet if it has rdf:type owl:Restriction or equivalent // and the combination of owl:onProperty and owl:hasValue (or equivalents) Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, HasValueRestriction.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an Ontology facet if it has rdf:type owl:Ontology or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, Ontology.class ); } };
public static boolean isCardinalityQRestriction( Node node, EnhGraph eg ) { // node will support being a QualifiedRestriction facet if it has rdf:type owl:Restriction or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, CardinalityQRestriction.class ); }
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an OntClass facet if it has rdf:type owl:Class or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, OntClass.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an DataRange facet if it has rdf:type owl:Datarange and is a bNode Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, DataRange.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being an SymmetricProperty facet if it has rdf:type owl:SymmetricProperty or equivalent Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, SymmetricProperty.class ); } };
@Override public boolean canWrap( Node node, EnhGraph eg ) { // node will support being a SomeValuesFromRestriction facet if it has rdf:type owl:Restriction or equivalent // and the combination of owl:onProperty and owl:someValuesFrom (or equivalents) Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; return (profile != null) && profile.isSupported( node, eg, SomeValuesFromRestriction.class ); } };