1 19 20 package com.hp.hpl.jena.ontology.impl; 23 24 25 26 import com.hp.hpl.jena.enhanced.*; 29 import com.hp.hpl.jena.graph.*; 30 import com.hp.hpl.jena.ontology.*; 31 import com.hp.hpl.jena.util.iterator.ExtendedIterator; 32 33 34 35 44 public class ObjectPropertyImpl 45 extends OntPropertyImpl 46 implements ObjectProperty 47 { 48 51 54 59 public static Implementation factory = new Implementation() { 60 public EnhNode wrap( Node n, EnhGraph eg ) { 61 if (canWrap( n, eg )) { 62 return new ObjectPropertyImpl( n, eg ); 63 } 64 else { 65 throw new ConversionException( "Cannot convert node " + n + " to ObjectProperty"); 66 } 67 } 68 69 public boolean canWrap( Node node, EnhGraph eg ) { 70 Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; 72 return (profile != null) && profile.isSupported( node, eg, ObjectProperty.class ); 73 } 74 }; 75 76 77 80 83 91 public ObjectPropertyImpl( Node n, EnhGraph g ) { 92 super( n, g ); 93 } 94 95 96 99 105 public OntProperty getInverseOf() { 106 return super.getInverseOf().asObjectProperty(); 107 } 108 109 115 public ExtendedIterator listInverseOf() { 116 return super.listInverseOf().mapWith( new AsMapper( ObjectProperty.class )); 117 } 118 119 124 public OntProperty getInverse() { 125 OntProperty inv = super.getInverse(); 126 return (inv != null) ? inv.asObjectProperty() : null; 127 } 128 129 130 133 137 } 138 139 140 169 170 | Popular Tags |