1 18 19 package com.hp.hpl.jena.ontology.daml.impl; 22 23 24 import com.hp.hpl.jena.enhanced.*; 27 import com.hp.hpl.jena.graph.*; 28 import com.hp.hpl.jena.ontology.*; 29 import com.hp.hpl.jena.ontology.daml.*; 30 import com.hp.hpl.jena.vocabulary.*; 31 32 33 34 46 public class DAMLObjectPropertyImpl 47 extends DAMLPropertyImpl 48 implements DAMLObjectProperty 49 { 50 53 54 57 62 public static Implementation factory = new Implementation() { 63 public EnhNode wrap( Node n, EnhGraph eg ) { 64 if (canWrap( n, eg )) { 65 return new DAMLObjectPropertyImpl( n, eg ); 66 } 67 else { 68 throw new ConversionException( "Cannot convert node " + n.toString() + " to DAMLObjectProperty" ); 69 } 70 } 71 72 public boolean canWrap( Node n, EnhGraph g ) { 73 return hasType( n, g, DAML_OIL.ObjectProperty ); 74 } 75 }; 76 77 78 81 82 private PropertyAccessor m_propInverseOf = new PropertyAccessorImpl( getVocabulary().inverseOf(), this ); 83 84 85 86 89 97 public DAMLObjectPropertyImpl( Node n, EnhGraph g ) { 98 super( n, g ); 99 } 100 101 102 105 106 112 public void setIsTransitive( boolean transitive ) { 113 if (transitive) { 114 addRDFType( getVocabulary().TransitiveProperty() ); 115 } 116 else { 117 removeRDFType( getVocabulary().TransitiveProperty() ); 118 } 119 } 120 121 122 127 public boolean isTransitive() { 128 return hasRDFType( getVocabulary().TransitiveProperty() ) || 129 DAMLHierarchy.getInstance().isTransitiveProperty( this ); 130 } 131 132 133 139 public void setIsUnambiguous( boolean unambiguous ) { 140 if (unambiguous) { 141 addRDFType( getVocabulary().UnambiguousProperty() ); 142 } 143 else { 144 removeRDFType( getVocabulary().UnambiguousProperty() ); 145 } 146 } 147 148 149 154 public boolean isUnambiguous() { 155 return hasRDFType( getVocabulary().UnambiguousProperty() ); 156 } 157 158 159 168 public PropertyAccessor prop_inverseOf() { 169 return m_propInverseOf; 170 } 171 172 173 174 175 178 179 180 181 185 186 } 187 188 214 | Popular Tags |