org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom Java Examples
The following examples show how to use
org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyViewOntologyBuilder.java From owltools with BSD 3-Clause "New" or "Revised" License | 6 votes |
public Set<List<OWLObjectPropertyExpression>> getPropertyChains(OWLObjectProperty p) { LOG.info("Getting chains for: "+p); Set<List<OWLObjectPropertyExpression>> chains = new HashSet<List<OWLObjectPropertyExpression>>(); for (OWLSubPropertyChainOfAxiom spca : sourceOntology.getAxioms(AxiomType.SUB_PROPERTY_CHAIN_OF)) { if (spca.getSuperProperty().equals(p)) { List<OWLObjectPropertyExpression> chain = spca.getPropertyChain(); chains.add(chain); // note: limited form of cycle checking if (!chain.contains(p)) { chains.addAll(expandPropertyChain(chain)); } } } LOG.info(p+" ==> "+chains); return chains; }
Example #2
Source File: OWLGraphWrapperEdges.java From owltools with BSD 3-Clause "New" or "Revised" License | 6 votes |
private Map<OWLObjectProperty,Set<List<OWLObjectProperty>>> getPropertyChainMap() { if (pcMap == null) { pcMap = new HashMap<OWLObjectProperty,Set<List<OWLObjectProperty>>>(); for (OWLSubPropertyChainOfAxiom a : sourceOntology.getAxioms(AxiomType.SUB_PROPERTY_CHAIN_OF)) { //LOG.info("CHAIN:"+a+" // "+a.getPropertyChain().size()); if (a.getPropertyChain().size() == 2) { OWLObjectPropertyExpression p1 = a.getPropertyChain().get(0); OWLObjectPropertyExpression p2 = a.getPropertyChain().get(1); //LOG.info(" xxCHAIN:"+p1+" o "+p2); if (p1 instanceof OWLObjectProperty && p2 instanceof OWLObjectProperty) { List<OWLObjectProperty> list = new Vector<OWLObjectProperty>(); list.add((OWLObjectProperty) p2); list.add((OWLObjectProperty) a.getSuperProperty()); if (!pcMap.containsKey(p1)) pcMap.put((OWLObjectProperty) p1, new HashSet<List<OWLObjectProperty>>()); pcMap.get((OWLObjectProperty) p1).add(list); //LOG.info(" xxxCHAIN:"+p1+" ... "+list); } } else { // TODO } } } return pcMap; }
Example #3
Source File: AbstractOwlAxiomConverterVisitor.java From elk-reasoner with Apache License 2.0 | 5 votes |
@Override public T visit(OWLSubPropertyChainOfAxiom axiom) { throw new IllegalArgumentException( OWLSubPropertyChainOfAxiom.class.getSimpleName() + " cannot be converted to " + getTargetClass().getSimpleName()); }
Example #4
Source File: OWLInAboxTranslator.java From owltools with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void tr(OWLSubPropertyChainOfAxiom ax) { List<OWLObjectPropertyExpression> chain = new ArrayList<OWLObjectPropertyExpression>(); for (OWLObjectPropertyExpression p : ax.getPropertyChain()) { chain.add(trTypeLevel(p)); } add(getOWLDataFactory().getOWLSubPropertyChainOfAxiom(chain, trTypeLevel(ax.getSuperProperty()))); }
Example #5
Source File: GraphOwlVisitor.java From SciGraph with Apache License 2.0 | 5 votes |
@Override public Void visit(OWLSubPropertyChainOfAxiom axiom) { long chain = getOrCreateNode(getIri(axiom.getSuperProperty())); int i = 0; for (OWLObjectPropertyExpression property : axiom.getPropertyChain()) { long link = getOrCreateNode(getIri(property)); long relationship = getOrCreateRelationship(chain, link, OwlRelationships.OWL_PROPERTY_CHAIN_AXIOM); graph.setRelationshipProperty(relationship, "order", i++); } return null; }
Example #6
Source File: OwlConverter.java From elk-reasoner with Apache License 2.0 | 4 votes |
@SuppressWarnings("static-method") public ElkObjectPropertyChain convert( OWLSubPropertyChainOfAxiom owlSubPropertyChainOfAxiom) { return new ElkObjectPropertyChainWrap<List<? extends OWLObjectPropertyExpression>>( owlSubPropertyChainOfAxiom.getPropertyChain()); }
Example #7
Source File: OwlAxiomConverterVisitor.java From elk-reasoner with Apache License 2.0 | 4 votes |
@Override public ElkAxiom visit(OWLSubPropertyChainOfAxiom owlSubPropertyChainOfAxiom) { return new ElkSubObjectPropertyChainOfAxiomWrap<OWLSubPropertyChainOfAxiom>( owlSubPropertyChainOfAxiom); }
Example #8
Source File: OwlObjectPropertyAxiomConverterVisitor.java From elk-reasoner with Apache License 2.0 | 4 votes |
@Override public ElkObjectPropertyAxiom visit( OWLSubPropertyChainOfAxiom owlSubPropertyChainOfAxiom) { return new ElkSubObjectPropertyChainOfAxiomWrap<OWLSubPropertyChainOfAxiom>( owlSubPropertyChainOfAxiom); }
Example #9
Source File: FailingOwlAxiomVisitor.java From elk-reasoner with Apache License 2.0 | 4 votes |
@Override public void visit(OWLSubPropertyChainOfAxiom axiom) { defaultVisit(axiom); }
Example #10
Source File: AxiomAnnotationTools.java From owltools with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public OWLAxiom visit(OWLSubPropertyChainOfAxiom axiom) { return factory.getOWLSubPropertyChainOfAxiom(axiom.getPropertyChain(), axiom.getSuperProperty(), annotations); }
Example #11
Source File: CardinalityContraintsTools.java From owltools with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public void visit(OWLSubPropertyChainOfAxiom axiom) { }