/** * Adds a mapping from an ontology IRI to an ontology document IRI which * has a base of this mapper and a specified local name - in * other words the document IRI will be determined by resolving * the local name against the URI base of this mapper. */ public void addMapping(IRI ontologyIRI, String localName) { IRI documentIRI = base.resolve(localName); iriMap.put(ontologyIRI, documentIRI); }
/** * Processes xml:base reference if there is one. * @param atts the attributes potentially containing xml:base declaration */ protected void processXMLBase(Attributes atts) throws SAXException { m_baseIRIs.push(m_baseIRI); String value = atts.getValue(XMLNS, "base"); if (value != null) { try { m_baseIRI = m_baseIRI.resolve(value); resolvedIRIs.clear(); } catch (IllegalArgumentException e) { RDFParserException exception = new RDFParserException("New base IRI '" + value + "' cannot be resolved against curent base IRI " + m_baseIRI.toString(), m_documentLocator); exception.initCause(e); throw exception; } } }
/** * Adds a mapping from an ontology IRI to an ontology document IRI which has * a base of this mapper and a specified local name - in other words the * document IRI will be determined by resolving the local name against the * URI base of this mapper. * * @param ontologyIRI the ontology IRI * @param localName the document IRI */ public void addMapping(IRI ontologyIRI, String localName) { checkNotNull(localName, "localName cannot be null"); checkNotNull(ontologyIRI, "ontologyIRI cannot be null"); IRI documentIRI = base.resolve(localName); iriMap.put(ontologyIRI, documentIRI); }
/** * Adds a mapping from an ontology IRI to an ontology document IRI which has * a base of this mapper and a specified local name - in other words the * document IRI will be determined by resolving the local name against the * URI base of this mapper. * * @param ontologyIRI the ontology IRI * @param localName the document IRI */ public void addMapping(IRI ontologyIRI, String localName) { checkNotNull(localName, "localName cannot be null"); checkNotNull(ontologyIRI, "ontologyIRI cannot be null"); IRI documentIRI = base.resolve(localName); iriMap.put(ontologyIRI, documentIRI); }
/** * Adds a mapping from an ontology IRI to an ontology document IRI which has * a base of this mapper and a specified local name - in other words the * document IRI will be determined by resolving the local name against the * URI base of this mapper. * * @param ontologyIRI the ontology IRI * @param localName the document IRI */ public void addMapping(IRI ontologyIRI, String localName) { checkNotNull(localName, "localName cannot be null"); checkNotNull(ontologyIRI, "ontologyIRI cannot be null"); IRI documentIRI = base.resolve(localName); iriMap.put(ontologyIRI, documentIRI); }
IRI theIRI = m_baseIRI.resolve(uri); String u = theIRI.toString(); uriCache.put(u, theIRI);
public void testLuigiFamilyJena() { final OntModel ontModel = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, null); ontModel.read(_base + "basicFamilyReference.owl"); ontModel.read(_base + "basicFamilyRules.owl"); final Resource nella = ontModel.createResource(_luigiFamily.resolve("#Nella").toString()); final Property hasUncle = ontModel.createProperty(_luigiFamily.resolve("#hasUncle").toString()); final Resource dino = ontModel.createResource(_luigiFamily.resolve("#Dino").toString()); assertFalse(ontModel.contains(nella, hasUncle, dino)); }
.orNull(); if( baseIRI != null ) { iri = baseIRI.resolve( "#" + iri );
IRI baseIRI = ontology.getOntologyID().getOntologyIRI(); if( baseIRI != null ) iri = baseIRI.resolve( "#" + iri );
public void testLuigiFamilyOWLApi() throws Exception { final OWLOntologyManager manager = OWL._manager; final OWLOntology familyRef = manager.loadOntology(IRI.create(_base + "basicFamilyReference.owl")); final OWLOntology familyRules = manager.loadOntology(IRI.create(_base + "basicFamilyRules.owl")); final OWLOntology mergedOntology = OWL.Ontology(Stream.concat(familyRef.axioms(), familyRules.axioms())); final OpenlletReasoner reasoner = openllet.owlapi.OpenlletReasonerFactory.getInstance().createReasoner(mergedOntology); final OWLIndividual nella = OWL.Individual(_luigiFamily.resolve("#Nella")); final OWLObjectProperty hasUncle = OWL.ObjectProperty(_luigiFamily.resolve("#hasUncle")); final OWLIndividual dino = OWL.Individual(_luigiFamily.resolve("#Dino")); assertFalse(reasoner.isEntailed(OWL.propertyAssertion(nella, hasUncle, dino))); }
iri = baseIRI.resolve("#" + iri);
iri = baseIRI.resolve("#" + iri);
iri = baseIRI.resolve("#" + iri);