/** * @param knownVocab the set of tags that are known by this generator */ public OBOTagValuePairList(List<OBOVocabulary> knownVocab) { vocab = knownVocab; iriSFP = new SimpleIRIShortFormProvider(); }
@Override public String getShortForm(OWLEntity entity) { return uriShortFormProvider.getShortForm(entity.getIRI()); } }
protected String renderObject(OWLObject o) { if (o instanceof OWLAnnotationAssertionAxiom && ((OWLAnnotationAssertionAxiom) o).getSubject() instanceof IRI) { SimpleIRIShortFormProvider iriShortFormProvider = new SimpleIRIShortFormProvider(); OWLAnnotationAssertionAxiom axiom = (OWLAnnotationAssertionAxiom) o; StringBuffer buffer = new StringBuffer(iriShortFormProvider.getShortForm((IRI) axiom.getSubject())); buffer.append(" "); buffer.append(new ManchesterOWLSyntaxOWLObjectRendererImpl().render(axiom.getAnnotation())); return buffer.toString(); } else { return new ManchesterOWLSyntaxOWLObjectRendererImpl().render(o); } }
protected String renderObject(OWLObject o) { if (o instanceof OWLAnnotationAssertionAxiom && ((OWLAnnotationAssertionAxiom) o).getSubject() instanceof IRI) { SimpleIRIShortFormProvider iriShortFormProvider = new SimpleIRIShortFormProvider(); OWLAnnotationAssertionAxiom axiom = (OWLAnnotationAssertionAxiom) o; StringBuffer buffer = new StringBuffer(iriShortFormProvider.getShortForm((IRI) axiom.getSubject())); buffer.append(" "); buffer.append(new ManchesterOWLSyntaxOWLObjectRendererImpl().render(axiom.getAnnotation())); return buffer.toString(); } else { return new ManchesterOWLSyntaxOWLObjectRendererImpl().render(o); } }
/** * @param knownVocab the set of tags that are known by this generator */ public OBOTagValuePairList(List<OBOVocabulary> knownVocab) { this.vocab = knownVocab; iriSFP = new SimpleIRIShortFormProvider(); }
@Override public String getShortForm(OWLEntity entity) { return uriShortFormProvider.getShortForm(entity.getIRI()); } }
/** * @param knownVocab the set of tags that are known by this generator */ public OBOTagValuePairList(List<OBOVocabulary> knownVocab) { this.vocab = knownVocab; iriSFP = new SimpleIRIShortFormProvider(); }
@Override public String getShortForm(OWLEntity entity) { return uriShortFormProvider.getShortForm(entity.getIRI()); } }
public OWLObjectRenderingContext(DeprecatedObjectChecker deprecatedObjectChecker, ClassSatisfiabilityChecker classSatisfiabilityChecker, ObjectPropertySatisfiabilityChecker objectPropertySatisfiabilityChecker, DataPropertySatisfiabilityChecker dataPropertySatisfiabilityChecker, LinkFactory linkFactory, ShortFormProvider shortFormProvider, OntologyIRIShortFormProvider ontologyIRIShortFormProvider) { this.deprecatedObjectChecker = deprecatedObjectChecker; this.classSatisfiabilityChecker = classSatisfiabilityChecker; this.objectPropertySatisfiabilityChecker = objectPropertySatisfiabilityChecker; this.dataPropertySatisfiabilityChecker = dataPropertySatisfiabilityChecker; this.linkFactory = linkFactory; this.shortFormProvider = shortFormProvider; this.ontologyIRIShortFormProvider = ontologyIRIShortFormProvider; this.iriShortFormProvider = new SimpleIRIShortFormProvider(); }
public String getShortForm(OWLEntity entity) { return uriShortFormProvider.getShortForm(entity.getIRI()); }
public OWLObjectRenderingContext(DeprecatedObjectChecker deprecatedObjectChecker, ClassSatisfiabilityChecker classSatisfiabilityChecker, ObjectPropertySatisfiabilityChecker objectPropertySatisfiabilityChecker, DataPropertySatisfiabilityChecker dataPropertySatisfiabilityChecker, LinkFactory linkFactory, ShortFormProvider shortFormProvider, OntologyIRIShortFormProvider ontologyIRIShortFormProvider) { this.deprecatedObjectChecker = deprecatedObjectChecker; this.classSatisfiabilityChecker = classSatisfiabilityChecker; this.objectPropertySatisfiabilityChecker = objectPropertySatisfiabilityChecker; this.dataPropertySatisfiabilityChecker = dataPropertySatisfiabilityChecker; this.linkFactory = linkFactory; this.shortFormProvider = shortFormProvider; this.ontologyIRIShortFormProvider = ontologyIRIShortFormProvider; this.iriShortFormProvider = new SimpleIRIShortFormProvider(); }
@Nonnull @Override public String getShortForm(@Nonnull IRI iri) { OWLModelManager manager = editorKit.getOWLModelManager(); Set<OWLEntity> entityWithIri = manager.getActiveOntology().getEntitiesInSignature(iri); if(entityWithIri.isEmpty()) { return delegateIRIShortFormProvider.getShortForm(iri); } else { return manager.getRendering(entityWithIri.iterator().next()); } } }
/** * Constructs an annotation short form provider. * * @param annotationProperties A {@code List} of preferred annotation properties. The list is * searched from start to end, so that annotations that have a property at the start of * the list have a higher priority and are selected over annotations with properties that * appear towards or at the end of the list. * @param preferredLanguageMap A map which maps annotation properties to preferred languages. * For any given annotation property there may be a list of preferred languages. * Languages at the start of the list have a higher priority over languages at the end of * the list. This parameter may be empty but it must not be {@code null}. * @param ontologySetProvider An {@code OWLOntologySetProvider} which provides a set of ontology * from which candidate annotation axioms should be taken. For a given entity, all * ontologies are examined. * @param alternateShortFormProvider A short form provider which will be used to generate the * short form for an entity that does not have any annotations. This provider will also * be used in the case where the value of an annotation is an {@code OWLIndividual} for * providing the short form of the individual. */ public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider) { this(ontologySetProvider, alternateShortFormProvider, new SimpleIRIShortFormProvider(), annotationProperties, preferredLanguageMap); }
@Nonnull @Override public String getShortForm(@Nonnull IRI iri) { OWLModelManager manager = editorKit.getOWLModelManager(); Set<OWLEntity> entityWithIri = manager.getActiveOntology().getEntitiesInSignature(iri); if(entityWithIri.isEmpty()) { return delegateIRIShortFormProvider.getShortForm(iri); } else { return manager.getRendering(entityWithIri.iterator().next()); } } }
/** * Constructs an annotation short form provider. * * @param annotationProperties A {@code List} of preferred annotation properties. The list is * searched from start to end, so that annotations that have a property at the start of * the list have a higher priority and are selected over annotations with properties that * appear towards or at the end of the list. * @param preferredLanguageMap A map which maps annotation properties to preferred languages. * For any given annotation property there may be a list of preferred languages. * Languages at the start of the list have a higher priority over languages at the end of * the list. This parameter may be empty but it must not be {@code null}. * @param ontologySetProvider An {@code OWLOntologySetProvider} which provides a set of ontology * from which candidate annotation axioms should be taken. For a given entity, all * ontologies are examined. * @param alternateShortFormProvider A short form provider which will be used to generate the * short form for an entity that does not have any annotations. This provider will also * be used in the case where the value of an annotation is an {@code OWLIndividual} for * providing the short form of the individual. */ public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider) { this(ontologySetProvider, alternateShortFormProvider, new SimpleIRIShortFormProvider(), annotationProperties, preferredLanguageMap); }
String label = item.getLabel(); if(label == null){ label = iriSfp.getShortForm(IRI.create(uri));
/** * Constructs an annotation short form provider. * * @param annotationProperties A {@code List} of preferred annotation properties. The list is * searched from start to end, so that annotations that have a property at the start of * the list have a higher priority and are selected over annotations with properties that * appear towards or at the end of the list. * @param preferredLanguageMap A map which maps annotation properties to preferred languages. * For any given annotation property there may be a list of preferred languages. * Languages at the start of the list have a higher priority over languages at the end of * the list. This parameter may be empty but it must not be {@code null}. * @param ontologySetProvider An {@code OWLOntologySetProvider} which provides a set of ontology * from which candidate annotation axioms should be taken. For a given entity, all * ontologies are examined. * @param alternateShortFormProvider A short form provider which will be used to generate the * short form for an entity that does not have any annotations. This provider will also * be used in the case where the value of an annotation is an {@code OWLIndividual} for * providing the short form of the individual. */ public AnnotationValueShortFormProvider(List<OWLAnnotationProperty> annotationProperties, Map<OWLAnnotationProperty, List<String>> preferredLanguageMap, OWLOntologySetProvider ontologySetProvider, ShortFormProvider alternateShortFormProvider) { this(ontologySetProvider, alternateShortFormProvider, new SimpleIRIShortFormProvider(), annotationProperties, preferredLanguageMap); }
@Nonnull @Override public String getShortForm(@Nonnull OWLEntity entity) { queryTemplate.clearParams(); queryTemplate.setIri("entity", entity.toStringID()); queryTemplate.setIri("labelProperty", labelProperty); Query query = queryTemplate.asQuery(); try(QueryExecution qe = qef.createQueryExecution(query)) { ResultSet rs = qe.execSelect(); String label = null; if(rs.hasNext()){ label = rs.next().getLiteral("label").asLiteral().getLexicalForm(); } else { label = fallback.getShortForm(entity.getIRI()); } return label; } } }
public DLSyntaxObjectRenderer() { this.shortFormProvider = new SimpleShortFormProvider(); this.iriShortFormProvider = new SimpleIRIShortFormProvider(); this.buffer = new StringBuilder(); }
/** * Default constructor. */ public DLSyntaxObjectRenderer() { shortFormProvider = new SimpleShortFormProvider(); iriShortFormProvider = new SimpleIRIShortFormProvider(); buffer = new StringBuilder(); }