Java Doc for OntResourceImpl.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » ontology » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.ontology.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.enhanced.Polymorphic
      com.hp.hpl.jena.enhanced.EnhNode
         com.hp.hpl.jena.rdf.model.impl.ResourceImpl
            com.hp.hpl.jena.ontology.impl.OntResourceImpl

All known Subclasses:   com.hp.hpl.jena.ontology.impl.OntClassImpl,  com.hp.hpl.jena.ontology.impl.DataRangeImpl,  com.hp.hpl.jena.ontology.impl.OntPropertyImpl,  com.hp.hpl.jena.ontology.impl.AllDifferentImpl,  com.hp.hpl.jena.ontology.impl.IndividualImpl,  com.hp.hpl.jena.ontology.impl.OntologyImpl,
OntResourceImpl
public class OntResourceImpl extends ResourceImpl implements OntResource(Code)

Abstract base class to provide shared implementation for implementations of ontology resources.


author:
   Ian Dickinson, HP Labs
author:
   (email)
version:
   CVS $Id: OntResourceImpl.java,v 1.67 2008/01/02 12:08:03 andy_seaborne Exp $

Inner Class :protected static class AsMapper implements Map1
Inner Class :protected static class SubjectAsMapper implements Map1
Inner Class :protected static class SubjectMapper implements Map1
Inner Class :protected static class ObjectAsMapper implements Map1
Inner Class :protected class ObjectAsStringMapper implements Map1
Inner Class :protected static class ObjectMapper implements Map1
Inner Class :protected static class ObjectAsOntResourceMapper extends ObjectMapper
Inner Class :protected class LangTagFilter extends Filter
Inner Class :protected class SingleEqualityFilter extends Filter

Field Summary
final public static  String[]KNOWN_LANGUAGES
    
public static  Implementationfactory
     A factory for generating OntResource facets from nodes in enhanced graphs.

Constructor Summary
public  OntResourceImpl(Node n, EnhGraph g)
    

Construct an ontology resource represented by the given node in the given graph.


Method Summary
public  voidaddComment(String comment, String lang)
    
public  voidaddComment(Literal comment)
    
public  voidaddDifferentFrom(Resource res)
    
public  voidaddIsDefinedBy(Resource res)
    
public  voidaddLabel(String label, String lang)
    
public  voidaddLabel(Literal label)
    
protected  voidaddListPropertyValue(Property p, String name, RDFNode value)
    
protected  voidaddPropertyValue(Property p, String name, RDFNode value)
    
public  voidaddRDFType(Resource cls)
    
public  voidaddSameAs(Resource res)
    
public  voidaddSeeAlso(Resource res)
    
public  voidaddVersionInfo(String info)
    
public  AllDifferentasAllDifferent()
    
public  AnnotationPropertyasAnnotationProperty()
    
public  OntClassasClass()
    
public  DataRangeasDataRange()
    
public  DatatypePropertyasDatatypeProperty()
    
public  IndividualasIndividual()
    
public  ObjectPropertyasObjectProperty()
    
public  OntologyasOntology()
    
public  OntPropertyasProperty()
    
protected  voidcheckProfile(Object term, String name)
    
protected  RDFNodeconvertToType(Resource type, String name, Class cls)
    
public  intgetCardinality(Property p)
    

Answer the cardinality of the given property on this resource.

public  StringgetComment(String lang)
    

Answer the comment string for this object.

public  OntResourcegetDifferentFrom()
    

Answer a resource that is declared to be distinct from this resource.

public  ResourcegetIsDefinedBy()
    

Answer a resource that is declared to provide a definition of this resource.

public  StringgetLabel(String lang)
    

Answer the label string for this object.

public  OntModelgetOntModel()
    

Answer the model that this resource is attached to, assuming that it is an OntModel .

public  ProfilegetProfile()
    

Answer the ontology language profile that governs the ontology model to which this ontology resource is attached.

public  RDFNodegetPropertyValue(Property property)
    

Answer the value of a given RDF property for this ontology resource, or null if it doesn't have one.

public  ResourcegetRDFType()
    

Answer the rdf:type (ie the class) of this resource.

public  ResourcegetRDFType(boolean direct)
    

Answer the rdf:type (ie the class) of this resource.

public  OntResourcegetSameAs()
    

Answer a resource that is declared to be the same as this resource.

public  ResourcegetSeeAlso()
    

Answer a resource that provides additional information about this resource.

public  StringgetVersionInfo()
    

Answer the version information string for this object.

public  booleanhasComment(String comment, String lang)
    

Answer true if this resource has the given comment.


Parameters:
  comment - The comment to test for
Parameters:
  lang - The optional language tag, or null for don't care.
public  booleanhasComment(Literal comment)
    
public  booleanhasLabel(String label, String lang)
    

Answer true if this resource has the given label


Parameters:
  label - The label to test for
Parameters:
  lang - The optional language tag, or null for don't care.
public  booleanhasLabel(Literal label)
    
protected  booleanhasPropertyValue(Property p, String name, RDFNode value)
    
public  booleanhasRDFType(String uri)
    
public  booleanhasRDFType(Resource ontClass)
    

Answer true if this resource is a member of the class denoted by the given class resource.

public  booleanhasRDFType(Resource ontClass, boolean direct)
    

Answer true if this resource is a member of the class denoted by the given class resource.


Parameters:
  ontClass - Denotes a class to which this value may belong
Parameters:
  direct - If true, only consider the direct types of this resource, ignoringthe super-classes of the stated types.
protected  booleanhasRDFType(Resource ontClass, String name, boolean direct)
    
public  booleanhasSeeAlso(Resource res)
    
protected static  booleanhasType(Node n, EnhGraph g, Resource type)
    
public  booleanhasVersionInfo(String info)
    
public  booleanisAllDifferent()
    
public  booleanisAnnotationProperty()
    
public  booleanisClass()
    
public  booleanisDataRange()
    
public  booleanisDatatypeProperty()
    
public  booleanisDefinedBy(Resource res)
    
public  booleanisDifferentFrom(Resource res)
    
public  booleanisIndividual()
    
public  booleanisObjectProperty()
    
public  booleanisOntLanguageTerm()
    

Answer true if this resource is a symbol in one of the standard ontology languages supported by Jena: RDF, RDFS, OWL or DAML+OIL.

public  booleanisOntology()
    
public  booleanisProperty()
    
public  booleanisSameAs(Resource res)
    
protected  booleanlangTagMatch(String desired, String target)
    
protected  ExtendedIteratorlistAs(Property p, String name, Class cls)
    
public  ExtendedIteratorlistComments(String lang)
    
public  ExtendedIteratorlistDifferentFrom()
    

Answer an iterator over all of the resources that are declared to be different from this resource.

protected  ExtendedIteratorlistDirectPropertyValues(Property p, String name, Class cls, Property orderRel, boolean direct, boolean inverse)
    
public  ExtendedIteratorlistIsDefinedBy()
    

Answer an iterator over all of the resources that are declared to define this resource.

public  ExtendedIteratorlistLabels(String lang)
    
public  NodeIteratorlistPropertyValues(Property property)
    

Answer an iterator over the set of all values for a given RDF property.

public  ExtendedIteratorlistRDFTypes(boolean direct)
    

Answer an iterator over the RDF classes to which this resource belongs.


Parameters:
  direct - If true, only answer those resources that are direct typesof this resource, not the super-classes of the class etc.
public  ExtendedIteratorlistSameAs()
    

Answer an iterator over all of the resources that are declared to be the same as this resource.

public  ExtendedIteratorlistSeeAlso()
    
public  ExtendedIteratorlistVersionInfo()
    
protected  ObjectobjectAs(Property p, String name, Class asClass)
    
protected  intobjectAsInt(Property p, String name)
    
protected  OntPropertyobjectAsProperty(Property p, String name)
    
protected  OntResourceobjectAsResource(Property p, String name)
    
public  voidremove()
    

Removes this resource from the ontology by deleting any statements that refer to it, as either statement-subject or statement-object. If this resource is a property, this method will not remove statements whose predicate is this property.

Caveat: Jena RDF models contain statements, not resources per se, so this method simulates removal of an object by removing all of the statements that have this resource as subject or object, with one exception.

public  voidremoveComment(String comment, String lang)
    

Remove the statement that the given string is a comment on this resource.

public  voidremoveComment(Literal comment)
    

Remove the statement that the given string is a comment on this resource.

public  voidremoveDefinedBy(Resource res)
    

Remove the statement that this resource is defined by the given resource.

public  voidremoveDifferentFrom(Resource res)
    

Remove the statement that this resource is different the given resource.

public  voidremoveLabel(String label, String lang)
    

Remove the statement that the given string is a label for this resource.

public  voidremoveLabel(Literal label)
    

Remove the statement that the given string is a label for this resource.

public  voidremoveProperty(Property property, RDFNode value)
    
protected  voidremovePropertyValue(Property prop, String name, RDFNode value)
    
public  voidremoveRDFType(Resource cls)
    

Remove the statement that this resource is of the given RDF type.

public  voidremoveSameAs(Resource res)
    

Remove the statement that this resource is the same as the given resource.

public  voidremoveSeeAlso(Resource res)
    

Remove the statement indicating the given resource as a source of additional information about this resource.

public  voidremoveVersionInfo(String info)
    

Remove the statement that the given string provides version information about this resource.

protected  StringselectLang(StmtIterator stmts, String lang)
    

Answer the literal with the language tag that best matches the required language


Parameters:
  stmts - A StmtIterator over the candidates
Parameters:
  lang - The language we're searching for, assumed non-null.
public  voidsetComment(String comment, String lang)
    

Assert that the given string is the comment on this resource.

public  voidsetDifferentFrom(Resource res)
    

Assert that the given resource and this resource are distinct.

public  voidsetIsDefinedBy(Resource res)
    

Assert that the given resource provides a source of definitions about this resource.

public  voidsetLabel(String label, String lang)
    

Assert that the given string is the value of the label for this resource.

public  voidsetPropertyValue(Property property, RDFNode value)
    

Set the value of the given property of this ontology resource to the given value, encoded as an RDFNode.

protected  voidsetPropertyValue(Property p, String name, RDFNode value)
    
public  voidsetRDFType(Resource cls)
    

Set the RDF type (i.e.

public  voidsetSameAs(Resource res)
    

Assert equivalence between the given resource and this resource.

public  voidsetSeeAlso(Resource res)
    
public  voidsetVersionInfo(String info)
    

Assert that the given string is the value of the version info for this resource.


Field Detail
KNOWN_LANGUAGES
final public static String[] KNOWN_LANGUAGES(Code)
List of namespaces that are reserved for known ontology languages



factory
public static Implementation factory(Code)
A factory for generating OntResource facets from nodes in enhanced graphs. Note: should not be invoked directly by user code: use com.hp.hpl.jena.rdf.model.RDFNode.as as() instead.




Constructor Detail
OntResourceImpl
public OntResourceImpl(Node n, EnhGraph g)(Code)

Construct an ontology resource represented by the given node in the given graph.


Parameters:
  n - The node that represents the resource
Parameters:
  g - The enh graph that contains n




Method Detail
addComment
public void addComment(String comment, String lang)(Code)

Add the given comment to this resource.


Parameters:
  comment - A comment string for this resource
Parameters:
  lang - The language attribute for this comment (EN, FR, etc) or null if not specified.
exception:
  OntProfileException - If the Profile.COMMENT property is not supported in the current language profile.



addComment
public void addComment(Literal comment)(Code)

Add the given comment to this resource.


Parameters:
  comment - The literal comment
exception:
  OntProfileException - If the Profile.COMMENT property is not supported in the current language profile.



addDifferentFrom
public void addDifferentFrom(Resource res)(Code)

Add a resource that is declared to be equivalent to this resource.


Parameters:
  res - A resource that declared to be the same as this resource
exception:
  OntProfileException - If the Profile.DIFFERENT_FROM property is not supported in the current language profile.



addIsDefinedBy
public void addIsDefinedBy(Resource res)(Code)

Add a resource that is declared to provide a definition of this resource.


Parameters:
  res - A defining resource
exception:
  OntProfileException - If the Profile.IS_DEFINED_BY property is not supported in the current language profile.



addLabel
public void addLabel(String label, String lang)(Code)

Add the given label to this resource.


Parameters:
  label - A label string for this resource
Parameters:
  lang - The language attribute for this label (EN, FR, etc) or null if not specified.
exception:
  OntProfileException - If the Profile.LABEL property is not supported in the current language profile.



addLabel
public void addLabel(Literal label)(Code)

Add the given label to this resource.


Parameters:
  label - The literal label
exception:
  OntProfileException - If the Profile.LABEL property is not supported in the current language profile.



addListPropertyValue
protected void addListPropertyValue(Property p, String name, RDFNode value)(Code)
Add the given value to a list which is the value of the given property



addPropertyValue
protected void addPropertyValue(Property p, String name, RDFNode value)(Code)
Add the property value, checking that it is supported in the profile



addRDFType
public void addRDFType(Resource cls)(Code)

Add the given class as one of the rdf:type's for this resource.


Parameters:
  cls - An RDF resource denoting a new value for the rdf:type property.



addSameAs
public void addSameAs(Resource res)(Code)

Add a resource that is declared to be equivalent to this resource.


Parameters:
  res - A resource that declared to be the same as this resource
exception:
  OntProfileException - If the Profile.SAME_AS property is not supported in the current language profile.



addSeeAlso
public void addSeeAlso(Resource res)(Code)

Add a resource that is declared to provided additional information about the definition of this resource


Parameters:
  res - A resource that provides extra information on this resource
exception:
  OntProfileException - If the Profile.SEE_ALSO property is not supported in the current language profile.



addVersionInfo
public void addVersionInfo(String info)(Code)

Add the given version information to this resource.


Parameters:
  info - A version information string for this resource
exception:
  OntProfileException - If the Profile.VERSION_INFO property is not supported in the current language profile.



asAllDifferent
public AllDifferent asAllDifferent()(Code)

Answer a view of this resource as an 'all different' declaration

This resource, but viewed as an AllDifferent node
exception:
  ConversionException - if the resource cannot be converted to an all different declaration



asAnnotationProperty
public AnnotationProperty asAnnotationProperty()(Code)

Answer a view of this resource as an annotation property

This resource, but viewed as an AnnotationProperty
exception:
  ConversionException - if the resource cannot be converted to an annotation property



asClass
public OntClass asClass()(Code)

Answer a view of this resource as a class

This resource, but viewed as an OntClass
exception:
  ConversionException - if the resource cannot be converted to a class



asDataRange
public DataRange asDataRange()(Code)

Answer a view of this resource as a data range

This resource, but viewed as a DataRange
exception:
  ConversionException - if the resource cannot be converted to a data range



asDatatypeProperty
public DatatypeProperty asDatatypeProperty()(Code)

Answer a view of this resource as a datatype property

This resource, but viewed as a DatatypeProperty
exception:
  ConversionException - if the resource cannot be converted to a datatype property



asIndividual
public Individual asIndividual()(Code)

Answer a view of this resource as an individual

This resource, but viewed as an Individual
exception:
  ConversionException - if the resource cannot be converted to an individual



asObjectProperty
public ObjectProperty asObjectProperty()(Code)

Answer a view of this resource as an object property

This resource, but viewed as an ObjectProperty
exception:
  ConversionException - if the resource cannot be converted to an object property



asOntology
public Ontology asOntology()(Code)

Answer a view of this resource as an ontology description node

This resource, but viewed as an Ontology
exception:
  ConversionException - if the resource cannot be converted to an ontology description node



asProperty
public OntProperty asProperty()(Code)

Answer a view of this resource as a property

This resource, but viewed as an OntProperty
exception:
  ConversionException - if the resource cannot be converted to a property



checkProfile
protected void checkProfile(Object term, String name)(Code)
Throw an exception if a term is not in the profile
Parameters:
  term - The term being checked
Parameters:
  name - The name of the term
exception:
  ProfileException - if term is null (indicating it is not in the profile)



convertToType
protected RDFNode convertToType(Resource type, String name, Class cls)(Code)
Convert this resource to the facet denoted by cls, by adding rdf:type type if necessary



getCardinality
public int getCardinality(Property p)(Code)

Answer the cardinality of the given property on this resource. The cardinality is the number of distinct values there are for the property.


Parameters:
  p - A property The cardinality for the property p on this resource, as aninteger greater than or equal to zero.



getComment
public String getComment(String lang)(Code)

Answer the comment string for this object. If there is more than one such resource, an arbitrary selection is made.


Parameters:
  lang - The language attribute for the desired comment (EN, FR, etc) or null for don't care. Willattempt to retreive the most specific comment matching the given language

A comment string matching the given language, or null if there is no matching comment.
exception:
  OntProfileException - If the Profile.COMMENT property is not supported in the current language profile.



getDifferentFrom
public OntResource getDifferentFrom()(Code)

Answer a resource that is declared to be distinct from this resource. If there is more than one such resource, an arbitrary selection is made.

res An ont resource that declared to be different from this resource
exception:
  OntProfileException - If the Profile.DIFFERENT_FROM property is not supported in the current language profile.



getIsDefinedBy
public Resource getIsDefinedBy()(Code)

Answer a resource that is declared to provide a definition of this resource. If there is more than one such resource, an arbitrary selection is made.

res An ont resource that is declared to provide a definition of this resource
exception:
  OntProfileException - If the Profile.IS_DEFINED_BY property is not supported in the current language profile.



getLabel
public String getLabel(String lang)(Code)

Answer the label string for this object. If there is more than one such resource, an arbitrary selection is made.


Parameters:
  lang - The language attribute for the desired label (EN, FR, etc) or null for don't care. Willattempt to retreive the most specific label matching the given language

A label string matching the given language, or null if there is no matching label.
exception:
  OntProfileException - If the Profile.LABEL property is not supported in the current language profile.



getOntModel
public OntModel getOntModel()(Code)

Answer the model that this resource is attached to, assuming that it is an OntModel . If this resource is not attached to any model, or is (unusually) attached to a model that is not an OntModel, answer null.

The ont model that this resource is attached to, or null.



getProfile
public Profile getProfile()(Code)

Answer the ontology language profile that governs the ontology model to which this ontology resource is attached.

The language profile for this ontology resource
throws:
  JenaException - if the resource is not bound to an OntModel, sincethat's the only way to get the profile for the resource



getPropertyValue
public RDFNode getPropertyValue(Property property)(Code)

Answer the value of a given RDF property for this ontology resource, or null if it doesn't have one. The value is returned as an RDFNode, from which the concrete data value can be extracted for literals. If the value is a resource, it will present the OntResource facet. If there is more than one RDF statement with the given property for the current value, it is not defined which of the values will be returned.


Parameters:
  property - An RDF property An RDFNode whose value is the value, or one of the values, of thegiven property. If the property is not defined the method returns null.



getRDFType
public Resource getRDFType()(Code)

Answer the rdf:type (ie the class) of this resource. If there is more than one type for this resource, the return value will be one of the values, but it is not specified which one (nor that it will consistently be the same one each time). Equivalent to getRDFType( false ).

A resource that is the rdf:type for this resource, or one of them ifmore than one is defined.



getRDFType
public Resource getRDFType(boolean direct)(Code)

Answer the rdf:type (ie the class) of this resource. If there is more than one type for this resource, the return value will be one of the values, but it is not specified which one (nor that it will consistently be the same one each time).


Parameters:
  direct - If true, only consider the direct types of this resource, and notthe super-classes of the type(s). A resource that is the rdf:type for this resource, or one of them ifmore than one is defined.



getSameAs
public OntResource getSameAs()(Code)

Answer a resource that is declared to be the same as this resource. If there is more than one such resource, an arbitrary selection is made.

res An ont resource that declared to be the same as this resource
exception:
  OntProfileException - If the Profile.SAME_AS property is not supported in the current language profile.



getSeeAlso
public Resource getSeeAlso()(Code)

Answer a resource that provides additional information about this resource. If more than one such resource is defined, make an arbitrary choice.

res A resource that provides additional information about this resource
exception:
  OntProfileException - If the Profile.SEE_ALSO property is not supported in the current language profile.



getVersionInfo
public String getVersionInfo()(Code)

Answer the version information string for this object. If there is more than one such resource, an arbitrary selection is made.

A version info string
exception:
  OntProfileException - If the Profile.VERSION_INFO property is not supported in the current language profile.



hasComment
public boolean hasComment(String comment, String lang)(Code)

Answer true if this resource has the given comment.


Parameters:
  comment - The comment to test for
Parameters:
  lang - The optional language tag, or null for don't care. True if this resource has comment as a comment.



hasComment
public boolean hasComment(Literal comment)(Code)

Answer true if this resource has the given comment.


Parameters:
  comment - The comment to test for True if this resource has comment as a comment.



hasLabel
public boolean hasLabel(String label, String lang)(Code)

Answer true if this resource has the given label


Parameters:
  label - The label to test for
Parameters:
  lang - The optional language tag, or null for don't care. True if this resource has label as a label.



hasLabel
public boolean hasLabel(Literal label)(Code)

Answer true if this resource has the given label


Parameters:
  label - The label to test for True if this resource has label as a label.



hasPropertyValue
protected boolean hasPropertyValue(Property p, String name, RDFNode value)(Code)
Answer true if the given property is defined in the profile, and has the given value



hasRDFType
public boolean hasRDFType(String uri)(Code)

Answer true if this resource is a member of the class denoted by the given URI.


Parameters:
  uri - Denotes the URI of a class to which this value may belong True if this resource has the given class as one of its rdf:type's.



hasRDFType
public boolean hasRDFType(Resource ontClass)(Code)

Answer true if this resource is a member of the class denoted by the given class resource. Includes all available types, so is equivalent to

 hasRDF( ontClass, false );
 


Parameters:
  ontClass - Denotes a class to which this value may belong True if this resource has the given class as one of its rdf:type's.



hasRDFType
public boolean hasRDFType(Resource ontClass, boolean direct)(Code)

Answer true if this resource is a member of the class denoted by the given class resource.


Parameters:
  ontClass - Denotes a class to which this value may belong
Parameters:
  direct - If true, only consider the direct types of this resource, ignoringthe super-classes of the stated types. True if this resource has the given class as one of its rdf:type's.



hasRDFType
protected boolean hasRDFType(Resource ontClass, String name, boolean direct)(Code)



hasSeeAlso
public boolean hasSeeAlso(Resource res)(Code)

Answer true if this resource has the given resource as a source of additional information.


Parameters:
  res - A resource to test against True if the res provides more information on this resource.



hasType
protected static boolean hasType(Node n, EnhGraph g, Resource type)(Code)
Answer true if the node has the given type in the graph



hasVersionInfo
public boolean hasVersionInfo(String info)(Code)

Answer true if this resource has the given version information


Parameters:
  info - Version information to test for True if this resource has info as version information.



isAllDifferent
public boolean isAllDifferent()(Code)

Answer true if this resource can be viewed as an 'all different' declaration

True if this resource can be viewed as an AllDifferent node



isAnnotationProperty
public boolean isAnnotationProperty()(Code)

Answer true if this resource can be viewed as an annotation property

True if this resource can be viewed as an AnnotationProperty



isClass
public boolean isClass()(Code)

Answer true if this resource can be viewed as a class

True if this resource can be viewed as an OntClass



isDataRange
public boolean isDataRange()(Code)

Answer true if this resource can be viewed as a data range

True if this resource can be viewed as a DataRange



isDatatypeProperty
public boolean isDatatypeProperty()(Code)

Answer true if this resource can be viewed as a datatype property

True if this resource can be viewed as a DatatypeProperty



isDefinedBy
public boolean isDefinedBy(Resource res)(Code)

Answer true if this resource is defined by the given resource.


Parameters:
  res - A resource to test against True if res defines this resource.



isDifferentFrom
public boolean isDifferentFrom(Resource res)(Code)

Answer true if this resource is different from the given resource.


Parameters:
  res - A resource to test against True if the resources are declared to be distinct via a differentFrom statement.



isIndividual
public boolean isIndividual()(Code)

Answer true if this resource can be viewed as an individual

True if this resource can be viewed as an Individual



isObjectProperty
public boolean isObjectProperty()(Code)

Answer true if this resource can be viewed as an object property

True if this resource can be viewed as an ObjectProperty



isOntLanguageTerm
public boolean isOntLanguageTerm()(Code)

Answer true if this resource is a symbol in one of the standard ontology languages supported by Jena: RDF, RDFS, OWL or DAML+OIL. Since these languages have restricted namespaces, this check is simply a convenient way of testing whether this resource is in one of those pre-declared namespaces.

True if this is a term in the language namespace for OWL, RDF, RDFS or DAML+OIL.



isOntology
public boolean isOntology()(Code)

Answer true if this resource can be viewed as an ontology description node

True if this resource can be viewed as an Ontology



isProperty
public boolean isProperty()(Code)

Answer true if this resource can be viewed as a property

True if this resource can be viewed as an OntProperty



isSameAs
public boolean isSameAs(Resource res)(Code)

Answer true if this resource is the same as the given resource.


Parameters:
  res - A resource to test against True if the resources are declared the same via a sameAs statement.



langTagMatch
protected boolean langTagMatch(String desired, String target)(Code)
Answer true if the desired lang tag matches the target lang tag



listAs
protected ExtendedIterator listAs(Property p, String name, Class cls)(Code)
Answer an iterator for the given property, whose values are .as() some class



listComments
public ExtendedIterator listComments(String lang)(Code)

Answer an iterator over all of the comment literals for this resource.

An iterator over RDF Literal's.
exception:
  OntProfileException - If the Profile.COMMENT property is not supported in the current language profile.



listDifferentFrom
public ExtendedIterator listDifferentFrom()(Code)

Answer an iterator over all of the resources that are declared to be different from this resource. Each element of the iterator will be an OntResource .

An iterator over the resources different from this resource.
exception:
  OntProfileException - If the Profile.DIFFERENT_FROM property is not supported in the current language profile.



listDirectPropertyValues
protected ExtendedIterator listDirectPropertyValues(Property p, String name, Class cls, Property orderRel, boolean direct, boolean inverse)(Code)

Return an iterator of values, respecting the 'direct' modifier


Parameters:
  p - The property whose values are required
Parameters:
  name - The short name of the property (for generating error messages)
Parameters:
  cls - Class object denoting the facet to map the returned values to
Parameters:
  orderRel - If direct, and we are not using an inference engine, this is the propertyto use to define the maximal lower elements of the partial order
Parameters:
  direct - If true, only return the direct (adjacent) values
Parameters:
  inverse - If true, use the inverse of p rather than p An iterator of nodes that are in relation p to this resource (possibly inverted), whichhave been mapped to the facet denoted by cls.



listIsDefinedBy
public ExtendedIterator listIsDefinedBy()(Code)

Answer an iterator over all of the resources that are declared to define this resource.

An iterator over the resources defining this resource.
exception:
  OntProfileException - If the Profile.IS_DEFINED_BY property is not supported in the current language profile.



listLabels
public ExtendedIterator listLabels(String lang)(Code)

Answer an iterator over all of the label literals for this resource.


Parameters:
  lang - The language to restrict any label values to, or null to select all languages An iterator over RDF Literal's.
exception:
  OntProfileException - If the Profile.LABEL property is not supported in the current language profile.



listPropertyValues
public NodeIterator listPropertyValues(Property property)(Code)

Answer an iterator over the set of all values for a given RDF property. Each value in the iterator will be an RDFNode, representing the value (object) of each statement in the underlying model.


Parameters:
  property - The property whose values are sought An Iterator over the values of the property



listRDFTypes
public ExtendedIterator listRDFTypes(boolean direct)(Code)

Answer an iterator over the RDF classes to which this resource belongs.


Parameters:
  direct - If true, only answer those resources that are direct typesof this resource, not the super-classes of the class etc. An iterator over the set of this resource's classes, each of whichwill be a Resource.



listSameAs
public ExtendedIterator listSameAs()(Code)

Answer an iterator over all of the resources that are declared to be the same as this resource. Each element of the iterator will be an OntResource .

An iterator over the resources equivalent to this resource.
exception:
  OntProfileException - If the Profile.SAME_AS property is not supported in the current language profile.



listSeeAlso
public ExtendedIterator listSeeAlso()(Code)

Answer an iterator over all of the resources that are declared to provide addition information about this resource.

An iterator over the resources providing additional definition on this resource.
exception:
  OntProfileException - If the Profile.SEE_ALSO property is not supported in the current language profile.



listVersionInfo
public ExtendedIterator listVersionInfo()(Code)

Answer an iterator over all of the version info strings for this resource.

An iterator over the version info strings for this resource.
exception:
  OntProfileException - If the Profile.VERSION_INFO property is not supported in the current language profile.



objectAs
protected Object objectAs(Property p, String name, Class asClass)(Code)
Answer the object of a statement with the given property, .as() the given class



objectAsInt
protected int objectAsInt(Property p, String name)(Code)
Answer the int value of a statement with the given property



objectAsProperty
protected OntProperty objectAsProperty(Property p, String name)(Code)
Answer the object of a statement with the given property, .as() an OntProperty



objectAsResource
protected OntResource objectAsResource(Property p, String name)(Code)
Answer the object of a statement with the given property, .as() an OntResource



remove
public void remove()(Code)

Removes this resource from the ontology by deleting any statements that refer to it, as either statement-subject or statement-object. If this resource is a property, this method will not remove statements whose predicate is this property.

Caveat: Jena RDF models contain statements, not resources per se, so this method simulates removal of an object by removing all of the statements that have this resource as subject or object, with one exception. If the resource is referenced in an RDF List, i.e. as the object of an rdf:first statement in a list cell, this reference is not removed. Removing an arbitrary rdf:first statement from the midst of a list, without doing other work to repair the list, would leave an ill-formed list in the model. Therefore, if this resource is known to appear in a list somewhere in the model, it should be separately deleted from that list before calling this remove method.




removeComment
public void removeComment(String comment, String lang)(Code)

Remove the statement that the given string is a comment on this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  comment - A comment string to be removed
Parameters:
  lang - A lang tag



removeComment
public void removeComment(Literal comment)(Code)

Remove the statement that the given string is a comment on this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  comment - A comment literal to be removed



removeDefinedBy
public void removeDefinedBy(Resource res)(Code)

Remove the statement that this resource is defined by the given resource. If this statement is not true of the current model, nothing happens.


Parameters:
  res - A resource that may be declared to define this resource



removeDifferentFrom
public void removeDifferentFrom(Resource res)(Code)

Remove the statement that this resource is different the given resource. If this statement is not true of the current model, nothing happens.


Parameters:
  res - A resource that may be declared to be differentFrom this resource



removeLabel
public void removeLabel(String label, String lang)(Code)

Remove the statement that the given string is a label for this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  label - A label string to be removed
Parameters:
  lang - A lang tag



removeLabel
public void removeLabel(Literal label)(Code)

Remove the statement that the given string is a label for this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  label - A label literal to be removed



removeProperty
public void removeProperty(Property property, RDFNode value)(Code)

Remove the specific RDF property-value pair from this DAML resource.


Parameters:
  property - The property to be removed
Parameters:
  value - The specific value of the property to be removed



removePropertyValue
protected void removePropertyValue(Property prop, String name, RDFNode value)(Code)
Remove a specified property-value pair, if it exists



removeRDFType
public void removeRDFType(Resource cls)(Code)

Remove the statement that this resource is of the given RDF type. If this statement is not true of the current model, nothing happens.


Parameters:
  cls - A resource denoting a class that that is to be removed from the classes of this resource



removeSameAs
public void removeSameAs(Resource res)(Code)

Remove the statement that this resource is the same as the given resource. If this statement is not true of the current model, nothing happens.


Parameters:
  res - A resource that may be declared to be the sameAs this resource



removeSeeAlso
public void removeSeeAlso(Resource res)(Code)

Remove the statement indicating the given resource as a source of additional information about this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  res - A resource that may be declared to provide additional information about this resource



removeVersionInfo
public void removeVersionInfo(String info)(Code)

Remove the statement that the given string provides version information about this resource. If this statement is not true of the current model, nothing happens.


Parameters:
  info - A version information string to be removed



selectLang
protected String selectLang(StmtIterator stmts, String lang)(Code)

Answer the literal with the language tag that best matches the required language


Parameters:
  stmts - A StmtIterator over the candidates
Parameters:
  lang - The language we're searching for, assumed non-null. The literal value that best matches the given language tag, or null if there are no matches



setComment
public void setComment(String comment, String lang)(Code)

Assert that the given string is the comment on this resource. Any existing statements for comment will be removed.


Parameters:
  comment - The comment for this resource
Parameters:
  lang - The language attribute for this comment (EN, FR, etc) or null if not specified.
exception:
  OntProfileException - If the Profile.COMMENT property is not supported in the current language profile.



setDifferentFrom
public void setDifferentFrom(Resource res)(Code)

Assert that the given resource and this resource are distinct. Any existing statements for differentFrom will be removed.


Parameters:
  res - The resource that is declared to be distinct from this resource
exception:
  OntProfileException - If the Profile.DIFFERENT_FROM property is not supported in the current language profile.



setIsDefinedBy
public void setIsDefinedBy(Resource res)(Code)

Assert that the given resource provides a source of definitions about this resource. Any existing statements for isDefinedBy will be removed.


Parameters:
  res - The resource that is declared to be a definition of this resource.
exception:
  OntProfileException - If the Profile.IS_DEFINED_BY property is not supported in the current language profile.



setLabel
public void setLabel(String label, String lang)(Code)

Assert that the given string is the value of the label for this resource. Any existing statements for label will be removed.


Parameters:
  label - The label for this resource
Parameters:
  lang - The language attribute for this label (EN, FR, etc) or null if not specified.
exception:
  OntProfileException - If the Profile.LABEL property is not supported in the current language profile.



setPropertyValue
public void setPropertyValue(Property property, RDFNode value)(Code)

Set the value of the given property of this ontology resource to the given value, encoded as an RDFNode. Maintains the invariant that there is at most one value of the property for a given resource, so existing property values are first removed. To add multiple properties, use OntResourceImpl.addProperty(Property,RDFNode) addProperty .


Parameters:
  property - The property to update
Parameters:
  value - The new value of the property as an RDFNode, or null toeffectively remove this property.



setPropertyValue
protected void setPropertyValue(Property p, String name, RDFNode value)(Code)
Set the property value, checking that it is supported in the profile



setRDFType
public void setRDFType(Resource cls)(Code)

Set the RDF type (i.e. the class) for this resource, replacing any existing rdf:type property. Any existing statements for the RDF type will first be removed.


Parameters:
  cls - The RDF resource denoting the new value for the rdf:type property,which will replace any existing type property.



setSameAs
public void setSameAs(Resource res)(Code)

Assert equivalence between the given resource and this resource. Any existing statements for sameAs will be removed.


Parameters:
  res - The resource that is declared to be the same as this resource
exception:
  OntProfileException - If the Profile.SAME_AS property is not supported in the current language profile.



setSeeAlso
public void setSeeAlso(Resource res)(Code)

Assert that the given resource provides additional information about the definition of this resource


Parameters:
  res - A resource that can provide additional information about this resource
exception:
  OntProfileException - If the Profile.SEE_ALSO property is not supported in the current language profile.



setVersionInfo
public void setVersionInfo(String info)(Code)

Assert that the given string is the value of the version info for this resource. Any existing statements for versionInfo will be removed.


Parameters:
  info - The version information for this resource
exception:
  OntProfileException - If the Profile.VERSION_INFO property is not supported in the current language profile.



Fields inherited from com.hp.hpl.jena.rdf.model.impl.ResourceImpl
final public static Implementation factory(Code)(Java Doc)
final public static Implementation rdfNodeFactory(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.rdf.model.impl.ResourceImpl
public Resource abort()(Code)(Java Doc)
public Resource addLiteral(Property p, boolean o)(Code)(Java Doc)
public Resource addLiteral(Property p, long o)(Code)(Java Doc)
public Resource addLiteral(Property p, char o)(Code)(Java Doc)
public Resource addLiteral(Property p, double o)(Code)(Java Doc)
public Resource addLiteral(Property p, float o)(Code)(Java Doc)
public Resource addLiteral(Property p, Object o)(Code)(Java Doc)
public Resource addProperty(Property p, long o)(Code)(Java Doc)
public Resource addProperty(Property p, float o)(Code)(Java Doc)
public Resource addProperty(Property p, double o)(Code)(Java Doc)
public Resource addProperty(Property p, String o)(Code)(Java Doc)
public Resource addProperty(Property p, String o, String l)(Code)(Java Doc)
public Resource addProperty(Property p, String lexicalForm, RDFDatatype datatype)(Code)(Java Doc)
public Resource addProperty(Property p, RDFNode o)(Code)(Java Doc)
public Resource addTypedProperty(Property p, boolean o)(Code)(Java Doc)
public Resource addTypedProperty(Property p, Object o)(Code)(Java Doc)
public Resource begin()(Code)(Java Doc)
public Resource commit()(Code)(Java Doc)
public AnonId getId()(Code)(Java Doc)
public String getLocalName()(Code)(Java Doc)
public Model getModel()(Code)(Java Doc)
protected ModelCom getModelCom()(Code)(Java Doc)
public String getNameSpace()(Code)(Java Doc)
public Node getNode()(Code)(Java Doc)
public Statement getProperty(Property p)(Code)(Java Doc)
public Statement getRequiredProperty(Property p)(Code)(Java Doc)
public String getURI()(Code)(Java Doc)
public boolean hasLiteral(Property p, boolean o)(Code)(Java Doc)
public boolean hasLiteral(Property p, long o)(Code)(Java Doc)
public boolean hasLiteral(Property p, char o)(Code)(Java Doc)
public boolean hasLiteral(Property p, double o)(Code)(Java Doc)
public boolean hasLiteral(Property p, float o)(Code)(Java Doc)
public boolean hasLiteral(Property p, Object o)(Code)(Java Doc)
public boolean hasProperty(Property p)(Code)(Java Doc)
public boolean hasProperty(Property p, String o)(Code)(Java Doc)
public boolean hasProperty(Property p, String o, String l)(Code)(Java Doc)
public boolean hasProperty(Property p, RDFNode o)(Code)(Java Doc)
public boolean hasTypedProperty(Property p, boolean o)(Code)(Java Doc)
public boolean hasURI(String uri)(Code)(Java Doc)
public RDFNode inModel(Model m)(Code)(Java Doc)
public StmtIterator listProperties(Property p)(Code)(Java Doc)
public StmtIterator listProperties()(Code)(Java Doc)
protected ModelCom mustHaveModel()(Code)(Java Doc)
public Resource removeAll(Property p)(Code)(Java Doc)
public Resource removeProperties()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Object visitWith(RDFVisitor rv)(Code)(Java Doc)

Fields inherited from com.hp.hpl.jena.enhanced.EnhNode
final protected EnhGraph enhGraph(Code)(Java Doc)
final protected Node node(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.enhanced.EnhNode
public RDFNode as(Class t)(Code)(Java Doc)
public Node asNode()(Code)(Java Doc)
public boolean canAs(Class t)(Code)(Java Doc)
protected boolean canSupport(Class t)(Code)(Java Doc)
protected Polymorphic convertTo(Class t)(Code)(Java Doc)
final public boolean equals(Object o)(Code)(Java Doc)
public EnhGraph getGraph()(Code)(Java Doc)
protected Personality getPersonality()(Code)(Java Doc)
final public int hashCode()(Code)(Java Doc)
final public boolean isAnon()(Code)(Java Doc)
final public boolean isLiteral()(Code)(Java Doc)
final public boolean isResource()(Code)(Java Doc)
final public boolean isURIResource()(Code)(Java Doc)
public boolean isValid()(Code)(Java Doc)
public EnhNode viewAs(Class t)(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.enhanced.Polymorphic
public synchronized void addView(Polymorphic other)(Code)(Java Doc)
protected boolean already(Class t)(Code)(Java Doc)
protected boolean alreadyHasView(Class t)(Code)(Java Doc)
final protected Polymorphic asInternal(Class t)(Code)(Java Doc)
abstract protected boolean canSupport(Class t)(Code)(Java Doc)
abstract protected Polymorphic convertTo(Class t)(Code)(Java Doc)
abstract public boolean equals(Object o)(Code)(Java Doc)
abstract protected Personality getPersonality()(Code)(Java Doc)
abstract public boolean isValid()(Code)(Java Doc)
public boolean supports(Class t)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.