@Override public String toString() { return iri.toString(); } }
@Override public String toStringID() { return iri.toString(); } }
public boolean setEditedObject(IRI editedObject) { if (editedObject != null) { iriTextField.setText(editedObject.toString()); } return editedObject != null; }
private static String getDefaultOntologyTagValue(IRI baseIRI) { URI baseURI = baseIRI.toURI(); String baseURIPath = baseURI.getPath(); if (baseURIPath == null) { return baseIRI.toString(); } int lastSlashIndex = baseURIPath.lastIndexOf("/"); if (lastSlashIndex == -1 || lastSlashIndex + 1 == baseURIPath.length()) { return baseURIPath; } return baseURIPath.substring(lastSlashIndex + 1); }
@SuppressWarnings("resource") protected InputSource getInputSource(OWLOntologyDocumentSource source, OWLOntologyLoaderConfiguration config) throws OWLOntologyInputSourceException { Reader in = DocumentSources.wrapInputAsReader(source, config); InputSource is = new InputSource(in); is.setSystemId(source.getDocumentIRI().toString()); return is; } }
private IRI getBaseIRI(OWLEntity entity) { Optional<String> remainder = entity.getIRI().getRemainder(); if (remainder.isPresent()){ IRI iri = entity.getIRI(); int remainderIndex = iri.toString().lastIndexOf(remainder.get()); if (remainderIndex != -1) { return IRI.create(iri.toString().substring(0, remainderIndex)); } } return entity.getIRI(); }
private void updateEntityMapUsingPrefixes(String prefix, Set<OWLEntity> matches) { int prefixLength = prefix.length(); String replacementText = getReplaceWithValue(); for (OWLEntity entity : matches) { String iriString = entity.getIRI().toString(); addToEntityMap(entity, replacementText + iriString.substring(prefixLength)); } }
private OWLAnnotationValue getAnnotationValue(IRI resVal) { if (isAnonymousNode(resVal)) { return anonProvider.getOWLAnonymousIndividual(resVal.toString()); } return resVal; }
@Override public IRI remapIRI(IRI i) { if (nodeCheckerDelegate.isAnonymousNode(i)) { // blank nodes do not need to be remapped in this method return i; } IRI computeIfAbsent = remappedIRIs.computeIfAbsent(i, x -> IRI.create(NodeID.nextAnonymousIRI())); remappedIRIStrings.put(i.toString(), computeIfAbsent); return computeIfAbsent; }
public String renderMarkdown(OWLEntity entity) { String displayName = modelManager.getRendering(entity); String unqotedDisplayName = RenderingEscapeUtils.unescape(displayName); return String.format("[%s](%s)", unqotedDisplayName, entity.getIRI().toString()); } }
/** * @param node subject or object node * @param vf value factory * @return blank node */ protected static BNode node(final RDFNode node, final ValueFactory vf) { if (node.getIRI().getNamespace().startsWith("_:")) { return vf.createBNode(node.getIRI().toString().substring(2)); } return vf.createBNode(node.getIRI().toString()); } }
public boolean isAnonymous(OWLClass cls){ if(cls.getIRI().toString().startsWith(DEFAULT_ANON_CLASS_URI_PREFIX)){ for (OWLOntology ont : mngr.getActiveOntologies()){ if (ont.containsClassInSignature(cls.getIRI())){ return true; } } } return false; }
/** * Writes a datatype attributed (used on Literal elements). The full * datatype IRI is written out. * * @param datatype The datatype */ public void writeDatatypeAttribute(OWLDatatype datatype) { writer.writeAttribute(DATATYPE_IRI.getIRI(), datatype.getIRI().toString()); }
/** * @param entity entity to rename * @return new name */ public String getName(OWLEntity entity) { if (entity.isBuiltIn()) { return entity.getIRI().toString(); } return entity.accept(this); }
@Override public void generateSearchMetadataFor(OWLEntity entity, String entityRendering, SearchMetadataImportContext context, SearchMetadataDB db) { SearchMetadata md = new SearchMetadata(SearchCategory.IRI, GROUP_DESCRIPTION, entity, entityRendering, entity.getIRI().toString()); db.addResult(md); } }
final public void Prefix() throws ParseException {String prefixName=""; IRI iri; jj_consume_token(PREFIX); jj_consume_token(OPENPAR); prefixName = PrefixName(); jj_consume_token(EQUALS); iri = FullIRI(); jj_consume_token(CLOSEPAR); prefixMap.put(prefixName, iri.toString()); }
public PropertyMenuItem(OWLAnnotationProperty prop) { super(getOWLModelManager().getRendering(prop)); property = prop; setToolTipText(property.getIRI().toString()); addActionListener(arg0 -> { onStateChanged(); }); setSelected(isRenderingProperty()); }
protected void writeImports(OWLImportsDeclaration decl) { fireSectionItemPrepared(IMPORT.toString()); write(IMPORT.toString()); write(":"); writeSpace(); fireSectionRenderingStarted(IMPORT.toString()); writeFullURI(decl.getIRI().toString()); writeNewLine(); fireSectionRenderingFinished(IMPORT.toString()); }