public void writeAnnotationURIAttribute(URI uri) { try { writer.writeAttribute(OWLXMLVocabulary.ANNOTATION_URI.toString(), uri.toString()); } catch (IOException e) { throw new RuntimeException(e); } } }
/** * @param cardinality cardinality */ public void writeCardinalityAttribute(int cardinality) { writer.writeAttribute(CARDINALITY_ATTRIBUTE.getIRI(), Integer.toString(cardinality)); }
PARSER_OWLXMLVocabulary(OWLXMLVocabulary name, Provider<OWLEH<?, ?>> create) { iri = IRI.create(Namespaces.OWL.toString(), name.getShortForm()); shortName = name.getShortForm(); this.create = create; }
public AbstractElementHandlerFactory(OWLXMLVocabulary v) { this.elementName = v.getShortName(); }
public void writeCardinalityAttribute(int cardinality) { try { writer.writeAttribute(OWLXMLVocabulary.CARDINALITY_ATTRIBUTE.getURI().toString(), Integer.toString(cardinality)); } catch (IOException e) { throw new RuntimeException(e); } }
public AbstractElementHandlerFactory(OWLXMLVocabulary v) { this.elementName = v.getShortName(); }
public void writeFacetAttribute(OWLFacet facet) { try { writer.writeAttribute(OWLXMLVocabulary.DATATYPE_FACET.getURI().toString(), facet.getIRI().toString()); } catch (IOException e) { throw new RuntimeException(e); } }
/** * @param name name */ public void writeStartElement(OWLXMLVocabulary name) { writer.writeStartElement(name.getIRI()); }
/** * Creates an auto-mapper which examines ontologies that reside in the specified zip file. * * @param zip The zip file to map. * @param baseIRI base iri for physical IRIs * @throws IOException if an exception reading from input is raised */ public ZipIRIMapper(ZipFile zip, String baseIRI) throws IOException { /** * A handler to handle RDF/XML files. The xml:base (if present) is taken to be the ontology * URI of the ontology document being parsed. */ handlerMap.put(Namespaces.RDF + "RDF", this::baseIRI); /** A handler that can handle OWL/XML files. */ handlerMap.put(OWLXMLVocabulary.ONTOLOGY.toString(), this::ontologyIRI); processFile(zip, baseIRI); }
@Override public void endElement(@Nullable String uri, @Nullable String localName, @Nullable String qName) { if (PREFIX.getShortForm().equals(localName)) { return; } if (!handlerStack.isEmpty()) { handlerStack.remove(0).endElement(); } bases.pop(); }
public void attribute(String localName, String value) throws OWLParserException { if (localName.equals(OWLXMLVocabulary.DATATYPE_IRI.getShortName())) { iri = getIRI(value); } else if(localName.equals("lang")) { lang = value; } }
public void writeNodeIDAttribute(NodeID nodeID) { try { writer.writeAttribute(OWLXMLVocabulary.NODE_ID.getURI().toString(), nodeID.toString()); } catch (IOException e) { throw new OWLRuntimeException(e); } }
/** * @param uri uri */ public void writeAnnotationURIAttribute(URI uri) { writer.writeAttribute(ANNOTATION_URI.getIRI(), uri.toString()); } }
/** * Creates an auto-mapper which examines ontologies that reside in the specified zip file. * * @param zip The zip file to map. * @param baseIRI base iri for physical IRIs * @throws IOException if an exception reading from input is raised */ public ZipIRIMapper(ZipFile zip, String baseIRI) throws IOException { /** * A handler to handle RDF/XML files. The xml:base (if present) is taken to be the ontology * URI of the ontology document being parsed. */ handlerMap.put(Namespaces.RDF + "RDF", this::baseIRI); /** A handler that can handle OWL/XML files. */ handlerMap.put(OWLXMLVocabulary.ONTOLOGY.toString(), this::ontologyIRI); processFile(zip, baseIRI); }
PARSER_OWLXMLVocabulary(OWLXMLVocabulary name, Provider<OWLEH<?, ?>> create) { iri = IRI.create(Namespaces.OWL.toString(), name.getShortForm()); shortName = name.getShortForm(); this.create = create; }
@Override public void attribute(String localName, String value) throws OWLParserException { if (localName.equals(OWLXMLVocabulary.DATATYPE_IRI.getShortName())) { iri = getIRI(value); } else if(localName.equals("lang")) { lang = value; } }
/** * A convenience method to write a prefix. * @param prefixName The name of the prefix (e.g. owl: is the prefix name for the OWL prefix) * @param iri The prefix iri */ public void writePrefix(String prefixName, String iri) throws IOException { writer.writeStartElement(OWLXMLVocabulary.PREFIX.getURI().toString()); if (prefixName.endsWith(":")) { String attName = prefixName.substring(0, prefixName.length() - 1); writer.writeAttribute(OWLXMLVocabulary.NAME_ATTRIBUTE.getURI().toString(), attName); } else { writer.writeAttribute(OWLXMLVocabulary.NAME_ATTRIBUTE.getURI().toString(), prefixName); } writer.writeAttribute(OWLXMLVocabulary.IRI_ATTRIBUTE.getURI().toString(), iri); writer.writeEndElement(); iriPrefixMap.put(iri, prefixName); }
/** * @param name name */ public void writeStartElement(OWLXMLVocabulary name) { writer.writeStartElement(name.getIRI()); }
/** * Creates an auto-mapper which examines ontologies that reside in the specified zip file. * * @param zip The zip file to map. * @param baseIRI base iri for physical IRIs * @throws IOException if an exception reading from input is raised */ public ZipIRIMapper(ZipFile zip, String baseIRI) throws IOException { /** * A handler to handle RDF/XML files. The xml:base (if present) is taken to be the ontology * URI of the ontology document being parsed. */ handlerMap.put(Namespaces.RDF + "RDF", this::baseIRI); /** A handler that can handle OWL/XML files. */ handlerMap.put(OWLXMLVocabulary.ONTOLOGY.toString(), this::ontologyIRI); processFile(zip, baseIRI); }
PARSER_OWLXMLVocabulary(OWLXMLVocabulary name, Provider<OWLEH<?, ?>> create) { iri = IRI.create(Namespaces.OWL.toString(), name.getShortForm()); shortName = name.getShortForm(); this.create = create; }