1 19 20 package com.hp.hpl.jena.ontology.impl; 23 24 25 import com.hp.hpl.jena.ontology.*; 28 import com.hp.hpl.jena.graph.*; 29 import com.hp.hpl.jena.enhanced.*; 30 import com.hp.hpl.jena.rdf.model.*; 31 32 33 42 public class AnnotationPropertyImpl 43 extends OntResourceImpl 44 implements AnnotationProperty 45 { 46 49 52 57 public static Implementation factory = new Implementation() { 58 public EnhNode wrap( Node n, EnhGraph eg ) { 59 if (canWrap( n, eg )) { 60 return new AnnotationPropertyImpl( n, eg ); 61 } 62 else { 63 throw new ConversionException( "Cannot convert node " + n + " to AnnotationProperty"); 64 } 65 } 66 67 public boolean canWrap( Node node, EnhGraph eg ) { 68 Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; 70 return (profile != null) && profile.isSupported( node, eg, AnnotationProperty.class ); 71 } 72 }; 73 74 75 78 86 public AnnotationPropertyImpl( Node n, EnhGraph g ) { 87 super( n, g ); 88 } 89 90 91 94 97 104 public boolean isProperty() { 105 return true; 106 } 107 108 109 112 public int getOrdinal() { 113 return ((Property) as( Property.class )).getOrdinal(); 114 } 115 116 117 120 124 } 125 126 127 156 | Popular Tags |