/** * Default constructor. */ public NamespaceUtil() { standardNamespacePrefixMappings.put(DublinCoreVocabulary.NAME_SPACE, "dc"); standardNamespacePrefixMappings.put(Namespaces.SKOS.toString(), "skos"); namespace2PrefixMap.put(Namespaces.OWL.toString(), "owl"); namespace2PrefixMap.put(Namespaces.RDFS.toString(), "rdfs"); namespace2PrefixMap.put(Namespaces.RDF.toString(), "rdf"); namespace2PrefixMap.put(Namespaces.XSD.toString(), "xsd"); }
protected void processXMLBase(Attributes attributes) { String base = attributes.getValue(Namespaces.XML.toString(), "base"); if (base != null) { bases.push(URI.create(base)); } else { bases.push(bases.peek()); } }
protected void processXMLBase(Attributes attributes) { String base = attributes.getValue(Namespaces.XML.toString(), "base"); if (base != null) { bases.push(URI.create(base)); } else { bases.push(bases.peek()); } }
@Nullable protected IRI ontologyIRI(Attributes attributes) { String ontURI = attributes.getValue(Namespaces.OWL.toString(), "ontologyIRI"); if (ontURI == null) { ontURI = attributes.getValue("ontologyIRI"); } if (ontURI == null) { return null; } return IRI.create(ontURI); }
@Nullable protected IRI baseIRI(Attributes attributes) { String baseValue = attributes.getValue(Namespaces.XML.toString(), "base"); if (baseValue == null) { return null; } return IRI.create(baseValue); }
@Nullable protected IRI baseIRI(Attributes attributes) { String baseValue = attributes.getValue(Namespaces.XML.toString(), "base"); if (baseValue == null) { return null; } return IRI.create(baseValue); }
OWL2Datatype(Namespaces namespace, String shortForm, Category category, boolean finite, String regEx) { iri = IRI.create(namespace.toString(), shortForm); this.shortForm = shortForm; prefixedName = namespace.getPrefixName() + ':' + shortForm; this.category = category; this.finite = finite; regExpression = regEx; pattern = Pattern.compile(regEx, Pattern.DOTALL); }
OWLFacet(Namespaces ns, String shortForm, String symbolicForm) { iri = IRI.create(ns.toString(), shortForm); this.shortForm = shortForm; this.symbolicForm = symbolicForm; prefixedName = ns.getPrefixName() + ':' + shortForm; }
TIMEVocabulary(Namespaces namespace, String shortName, EntityType<?> entityType) { this.namespace = namespace; this.shortName = shortName; prefixedName = namespace.getPrefixName() + ':' + shortName; iri = IRI.create(namespace.toString(), shortName); this.entityType = entityType; }
SWRLVocabulary(String name) { shortName = name; prefixedName = Namespaces.SWRL.getPrefixName() + ':' + name; iri = IRI.create(Namespaces.SWRL.toString(), name); }
SKOSVocabulary(String localname, EntityType<?> entityType) { localName = localname; prefixedName = Namespaces.SKOS.getPrefixName() + ':' + localname; this.entityType = entityType; iri = IRI.create(Namespaces.SKOS.toString(), localname); }
XSDVocabulary(String name) { shortName = name; prefixedName = Namespaces.XSD.getPrefixName() + ':' + name; iri = IRI.create(Namespaces.XSD.toString(), name); }
SWRLBuiltInsVocabulary(String name, int minArity, int maxArity) { shortName = name; prefixedName = Namespaces.SWRLB.getPrefixName() + ':' + name; iri = IRI.create(Namespaces.SWRLB.toString(), name); this.minArity = minArity; this.maxArity = maxArity; }
SWRLBuiltInsVocabulary(String name, int minArity, int maxArity) { shortName = name; prefixedName = Namespaces.SWRLB.getPrefixName() + ':' + name; iri = IRI.create(Namespaces.SWRLB.toString(), name); this.minArity = minArity; this.maxArity = maxArity; }
OWLFacet(Namespaces ns, String shortForm, String symbolicForm) { iri = IRI.create(ns.toString(), shortForm); this.shortForm = shortForm; this.symbolicForm = symbolicForm; prefixedName = ns.getPrefixName() + ':' + shortForm; }
PARSER_OWLXMLVocabulary(OWLXMLVocabulary name, Provider<OWLEH<?, ?>> create) { iri = IRI.create(Namespaces.OWL.toString(), name.getShortForm()); shortName = name.getShortForm(); this.create = create; }
PARSER_OWLXMLVocabulary(OWLXMLVocabulary name) { iri = IRI.create(Namespaces.OWL.toString(), name.getShortForm()); shortName = name.getShortForm(); create = () -> { throw new OWLRuntimeException( shortName + " vocabulary element does not have a handler"); }; }
/** * @param ontology ontology * @param format format */ public OWLOntologyXMLNamespaceManager(OWLOntology ontology, OWLDocumentFormat format) { super(getDefaultNamespace(ontology, format)); this.ontology = checkNotNull(ontology, "ontology cannot be null"); ontologyFormat = checkNotNull(format, "format cannot be null"); addWellKnownNamespace("skos", Namespaces.SKOS.toString()); addWellKnownNamespace("dc", DublinCoreVocabulary.NAME_SPACE); processOntology(); }
/** * @param ontology ontology * @param format format */ public OWLOntologyXMLNamespaceManager(OWLOntology ontology, OWLDocumentFormat format) { super(getDefaultNamespace(ontology, format)); this.ontology = checkNotNull(ontology, "ontology cannot be null"); ontologyFormat = checkNotNull(format, "format cannot be null"); addWellKnownNamespace("skos", Namespaces.SKOS.toString()); addWellKnownNamespace("dc", DublinCoreVocabulary.NAME_SPACE); processOntology(); }