1 19 20 package com.hp.hpl.jena.ontology.impl; 23 24 25 import com.hp.hpl.jena.enhanced.*; 28 import com.hp.hpl.jena.graph.Node; 29 import com.hp.hpl.jena.ontology.*; 30 31 32 41 public class QualifiedRestrictionImpl 42 extends RestrictionImpl 43 implements QualifiedRestriction 44 { 45 48 51 56 public static Implementation factory = new Implementation() { 57 public EnhNode wrap( Node n, EnhGraph eg ) { 58 if (canWrap( n, eg )) { 59 return new QualifiedRestrictionImpl( n, eg ); 60 } 61 else { 62 throw new ConversionException( "Cannot convert node " + n + " to QualifiedRestriction"); 63 } 64 } 65 66 public boolean canWrap( Node node, EnhGraph eg ) { 67 Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; 69 return (profile != null) && profile.isSupported( node, eg, QualifiedRestriction.class ); 70 } 71 }; 72 73 74 77 80 88 public QualifiedRestrictionImpl( Node n, EnhGraph g ) { 89 super( n, g ); 90 } 91 92 93 96 104 public void setHasClassQ( OntClass cls ) { 105 setPropertyValue( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q", cls ); 106 } 107 108 113 public OntClass getHasClassQ() { 114 return (OntClass) objectAs( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q", OntClass.class ); 115 } 116 117 124 public boolean hasHasClassQ( OntClass cls ) { 125 return hasPropertyValue( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q", cls ); 126 } 127 128 134 public void removeHasClassQ( OntClass cls ) { 135 removePropertyValue( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q", cls ); 136 } 137 138 139 142 146 } 147 148 174 | Popular Tags |