public String render(IRI iri) { // doesn't matter what type of entity we choose - the same value is returned. OWLEntity entity = getOWLModelManager().getOWLDataFactory().getOWLClass(iri); String shortForm = provider.getShortForm(entity); return escape(shortForm); }
public void initialise() { prefixManager = PrefixUtilities.getPrefixOWLOntologyFormat(getOWLModelManager()); super.initialise(); }
protected void processChanges(List<? extends OWLOntologyChange> changes) { final List<OWLAnnotationProperty> properties = provider.getAnnotationProperties(); for (OWLOntologyChange change : changes) { if (change.isAxiomChange() && change.getAxiom().getAxiomType().equals(AxiomType.ANNOTATION_ASSERTION)) { OWLAnnotationAssertionAxiom ax = (OWLAnnotationAssertionAxiom) change.getAxiom(); // @@TODO we need some way to determine whether the rendering really has changed due to these axioms // otherwise we're telling a whole load of things to update that don't need to if (properties.contains(ax.getProperty())){ OWLAnnotationSubject subject = ax.getSubject(); if (subject instanceof IRI) { IRI iri = (IRI) subject; OWLDataFactory factory = getOWLModelManager().getOWLDataFactory(); fireRenderingChanged(factory.getOWLClass(iri)); fireRenderingChanged(factory.getOWLObjectProperty(iri)); fireRenderingChanged(factory.getOWLDataProperty(iri)); fireRenderingChanged(factory.getOWLAnnotationProperty(iri)); fireRenderingChanged(factory.getOWLNamedIndividual(iri)); } } } } }
public void initialise() { final OWLDataFactory df = getOWLModelManager().getOWLDataFactory(); // convert IRI -> lang map into annotation property -> lang map final List<OWLAnnotationProperty> properties = new ArrayList<>(); ListMultimap<OWLAnnotationProperty, String> propLangMap = ArrayListMultimap.create(); final ListMultimap<IRI, String> iriLangMap = OWLRendererPreferences.getInstance().getAnnotationLangMap(); for (IRI iri : OWLRendererPreferences.getInstance().getAnnotationIRIs()){ final OWLAnnotationProperty ap = df.getOWLAnnotationProperty(iri); properties.add(ap); propLangMap.putAll(ap, iriLangMap.get(iri)); } provider = new AnnotationValueShortFormProvider( () -> getOWLModelManager().getActiveOntologies(), new OWLEntityRendererImpl(), new SimpleIRIShortFormProvider(), properties, toMap(propLangMap)); }
public void initialise() { final OWLDataFactory df = getOWLModelManager().getOWLDataFactory(); // convert IRI -> lang map into annotation property -> lang map final List<OWLAnnotationProperty> properties = new ArrayList<OWLAnnotationProperty>(); Map<OWLAnnotationProperty, List<String>> propLangMap = new HashMap<OWLAnnotationProperty, List<String>>(); final Map<IRI, List<String>> iriLangMap = OWLRendererPreferences.getInstance().getAnnotationLangMap(); for (IRI iri : OWLRendererPreferences.getInstance().getAnnotationIRIs()){ final OWLAnnotationProperty ap = df.getOWLAnnotationProperty(iri); properties.add(ap); propLangMap.put(ap, iriLangMap.get(iri)); } provider = new AnnotationValueShortFormProvider(properties, propLangMap, getOWLModelManager().getOWLOntologyManager()); }
protected void processChanges(List<? extends OWLOntologyChange> changes) { final List<OWLAnnotationProperty> properties = provider.getAnnotationProperties(); for (OWLOntologyChange change : changes) { if (change.isAxiomChange() && change.getAxiom().getAxiomType().equals(AxiomType.ANNOTATION_ASSERTION)) { OWLAnnotationAssertionAxiom ax = (OWLAnnotationAssertionAxiom) change.getAxiom(); // @@TODO we need some way to determine whether the rendering really has changed due to these axioms // otherwise we're telling a whole load of things to update that don't need to if (properties.contains(ax.getProperty())){ OWLAnnotationSubject subject = ax.getSubject(); if (subject instanceof IRI) { IRI iri = (IRI) subject; OWLDataFactory factory = getOWLModelManager().getOWLDataFactory(); fireRenderingChanged(factory.getOWLClass(iri)); fireRenderingChanged(factory.getOWLObjectProperty(iri)); fireRenderingChanged(factory.getOWLDataProperty(iri)); fireRenderingChanged(factory.getOWLAnnotationProperty(iri)); fireRenderingChanged(factory.getOWLNamedIndividual(iri)); } } } } }
public void initialise() { final OWLDataFactory df = getOWLModelManager().getOWLDataFactory(); // convert IRI -> lang map into annotation property -> lang map final List<OWLAnnotationProperty> properties = new ArrayList<>(); ListMultimap<OWLAnnotationProperty, String> propLangMap = ArrayListMultimap.create(); final ListMultimap<IRI, String> iriLangMap = OWLRendererPreferences.getInstance().getAnnotationLangMap(); for (IRI iri : OWLRendererPreferences.getInstance().getAnnotationIRIs()){ final OWLAnnotationProperty ap = df.getOWLAnnotationProperty(iri); properties.add(ap); propLangMap.putAll(ap, iriLangMap.get(iri)); } provider = new AnnotationValueShortFormProvider( () -> getOWLModelManager().getActiveOntologies(), new OWLEntityRendererImpl(), new SimpleIRIShortFormProvider(), properties, toMap(propLangMap)); }
public void initialise() { final OWLDataFactory df = getOWLModelManager().getOWLDataFactory(); // convert IRI -> lang map into annotation property -> lang map final List<OWLAnnotationProperty> properties = new ArrayList<OWLAnnotationProperty>(); Map<OWLAnnotationProperty, List<String>> propLangMap = new HashMap<OWLAnnotationProperty, List<String>>(); final Map<IRI, List<String>> iriLangMap = OWLRendererPreferences.getInstance().getAnnotationLangMap(); for (IRI iri : OWLRendererPreferences.getInstance().getAnnotationIRIs()){ final OWLAnnotationProperty ap = df.getOWLAnnotationProperty(iri); properties.add(ap); propLangMap.put(ap, iriLangMap.get(iri)); } provider = new AnnotationValueShortFormProvider(properties, propLangMap, getOWLModelManager().getOWLOntologyManager()); }
public String render(IRI iri) { // doesn't matter what type of entity we choose - the same value is returned. OWLEntity entity = getOWLModelManager().getOWLDataFactory().getOWLClass(iri); String shortForm = provider.getShortForm(entity); return escape(shortForm); }
protected void processChanges(List<? extends OWLOntologyChange> changes) { final List<OWLAnnotationProperty> properties = provider.getAnnotationProperties(); for (OWLOntologyChange change : changes) { if (change.isAxiomChange() && change.getAxiom().getAxiomType().equals(AxiomType.ANNOTATION_ASSERTION)) { OWLAnnotationAssertionAxiom ax = (OWLAnnotationAssertionAxiom) change.getAxiom(); // @@TODO we need some way to determine whether the rendering really has changed due to these axioms // otherwise we're telling a whole load of things to update that don't need to if (properties.contains(ax.getProperty())){ OWLAnnotationSubject subject = ax.getSubject(); if (subject instanceof IRI) { IRI iri = (IRI) subject; OWLDataFactory factory = getOWLModelManager().getOWLDataFactory(); fireRenderingChanged(factory.getOWLClass(iri)); fireRenderingChanged(factory.getOWLObjectProperty(iri)); fireRenderingChanged(factory.getOWLDataProperty(iri)); fireRenderingChanged(factory.getOWLAnnotationProperty(iri)); fireRenderingChanged(factory.getOWLNamedIndividual(iri)); } } } } }
public void initialise() { prefixManager = PrefixUtilities.getPrefixOWLOntologyFormat(getOWLModelManager()); super.initialise(); }
public String render(IRI iri) { // doesn't matter what type of entity we choose - the same value is returned. OWLEntity entity = getOWLModelManager().getOWLDataFactory().getOWLClass(iri); String shortForm = provider.getShortForm(entity); return escape(shortForm); }
protected void processChanges(List<? extends OWLOntologyChange> changes) { final List<OWLAnnotationProperty> properties = provider.getAnnotationProperties(); for (OWLOntologyChange change : changes) { if (change.isAxiomChange() && change.getAxiom().getAxiomType().equals(AxiomType.ANNOTATION_ASSERTION)) { OWLAnnotationAssertionAxiom ax = (OWLAnnotationAssertionAxiom) change.getAxiom(); // @@TODO we need some way to determine whether the rendering really has changed due to these axioms // otherwise we're telling a whole load of things to update that don't need to if (properties.contains(ax.getProperty())){ OWLAnnotationSubject subject = ax.getSubject(); if (subject instanceof IRI) { IRI iri = (IRI) subject; OWLDataFactory factory = getOWLModelManager().getOWLDataFactory(); fireRenderingChanged(factory.getOWLClass(iri)); fireRenderingChanged(factory.getOWLObjectProperty(iri)); fireRenderingChanged(factory.getOWLDataProperty(iri)); fireRenderingChanged(factory.getOWLAnnotationProperty(iri)); fireRenderingChanged(factory.getOWLNamedIndividual(iri)); } } } } }
public void initialise() { prefixManager = PrefixUtilities.getPrefixOWLOntologyFormat(getOWLModelManager()); super.initialise(); }
public String render(IRI iri) { // doesn't matter what type of entity we choose - the same value is returned. OWLEntity entity = getOWLModelManager().getOWLDataFactory().getOWLClass(iri); String shortForm = provider.getShortForm(entity); return escape(shortForm); }
public void initialise() { prefixManager = PrefixUtilities.getPrefixOWLOntologyFormat(getOWLModelManager()); super.initialise(); }