Java Doc for Resource.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » model » 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.rdf.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.hp.hpl.jena.rdf.model.Resource

All known Subclasses:   com.hp.hpl.jena.rdf.model.impl.ResourceImpl,
Resource
public interface Resource extends RDFNode(Code)
An RDF Resource. Resource instances when created may be associated with a specific model. Resources created by a model will refer to that model, and support a range of methods, such as getProperty() and addProperty() which will access or modify that model. This enables the programmer to write code in a compact and easy style.

Resources created by ResourceFactory will not refer to any model, and will not permit operations which require a model. Such resources are useful as general constants.

This interface provides methods supporting typed literals. This means that methods are provided which will translate a built in type, or an object to an RDF Literal. This translation is done by invoking the toString() method of the object, or its built in equivalent. The reverse translation is also supported. This is built in for built in types. Factory objects, provided by the application, are used for application objects.

This interface provides methods for supporting enhanced resources. An enhanced resource is a resource to which the application has added behaviour. RDF containers are examples of enhanced resources built in to this package. Enhanced resources are supported by encapsulating a resource created by an implementation in another class which adds the extra behaviour. Factory objects are used to construct such enhanced resources.


author:
   bwm
version:
   Release='$Name: $' Revision='$Revision: 1.28 $' Date='$Date: 2008/01/02 12:05:46 $'




Method Summary
public  Resourceabort()
     Abort the transaction in the associated model.
public  ResourceaddLiteral(Property p, boolean o)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddLiteral(Property p, long o)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddLiteral(Property p, char o)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddLiteral(Property value, double d)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddLiteral(Property value, float d)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddLiteral(Property p, Object o)
     Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model.
public  ResourceaddProperty(Property p, String o)
     Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  o - The value of the property to be added.
public  ResourceaddProperty(Property p, String o, String l)
     Add a property to this resource.
public  ResourceaddProperty(Property p, String lexicalForm, RDFDatatype datatype)
     Add a property to this resource.
public  ResourceaddProperty(Property p, RDFNode o)
     Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  o - The value of the property to be added.
public  Resourcebegin()
     Begin a transaction in the associated model.
public  Resourcecommit()
     Commit the transaction in the associated model.
public  booleanequals(Object o)
     Determine whether two objects represent the same resource.

A resource can only be equal to another resource. If both resources are not anonymous, then they are equal if the URI's are equal.

public  AnonIdgetId()
     Returns an a unique identifier for anonymous resources.

The id is unique within the scope of a particular implementation.

public  StringgetLocalName()
     Returns the name of this resource within its namespace.
public  ModelgetModel()
     Return the model associated with this resource.
public  StringgetNameSpace()
     Returns the namespace associated with this resource.
public  NodegetNode()
     Answer the underlying [SPI] Node of this Resource.
public  StatementgetProperty(Property p)
     Answer some statement (this, p, O) in the associated model.
public  StatementgetRequiredProperty(Property p)
     Get a property value of this resource.

The model associated with the resource instance is searched for statements whose subject is this resource and whose predicate is p.

public  StringgetURI()
     Return the URI of the resource, or null if it's a bnode.
public  booleanhasLiteral(Property p, boolean o)
     Answer true iff this resource has the value o for property p.
public  booleanhasLiteral(Property p, long o)
     Answer true iff this resource has the value o for property p.
public  booleanhasLiteral(Property p, char o)
     Answer true iff this resource has the value o for property p.
public  booleanhasLiteral(Property p, double o)
     Answer true iff this resource has the value o for property p.
public  booleanhasLiteral(Property p, float o)
     Answer true iff this resource has the value o for property p.
public  booleanhasLiteral(Property p, Object o)
     Answer true iff this resource has the value o for property p.
public  booleanhasProperty(Property p)
     Determine whether this resource has any values for a given property.
Parameters:
  p - The property sought.
public  booleanhasProperty(Property p, String o)
     Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought.
public  booleanhasProperty(Property p, String o, String l)
     Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought.
Parameters:
  l - The language of the property sought.
public  booleanhasProperty(Property p, RDFNode o)
     Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought.
public  booleanhasURI(String uri)
     Answer true iff this Resource is a URI resource with the given URI.
public  StmtIteratorlistProperties(Property p)
     List all the values of the property p.

Returns an iterator over all the statements in the associated model whose subject is this resource and whose predicate is p.


Parameters:
  p - The predicate sought.
public  StmtIteratorlistProperties()
     Return an iterator over all the properties of this resource.
public  ResourceremoveAll(Property p)
     Delete all the statements with predicate p for this resource from its associated model.
public  ResourceremoveProperties()
     Delete all the properties for this resource from the associated model.
public  StringtoString()
     Return a string representation of the resource.



Method Detail
abort
public Resource abort()(Code)
Abort the transaction in the associated model. This resource to permit cascading.



addLiteral
public Resource addLiteral(Property p, boolean o)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addLiteral
public Resource addLiteral(Property p, long o)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addLiteral
public Resource addLiteral(Property p, char o)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addLiteral
public Resource addLiteral(Property value, double d)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addLiteral
public Resource addLiteral(Property value, float d)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addLiteral
public Resource addLiteral(Property p, Object o)(Code)
Add the property p with the typed-literal value o to this resource, ie add (this, p, typed(o)) to this's model. Answer this resource. The typed literal is equal to one constructed by using this.getModel().createTypedLiteral(o).



addProperty
public Resource addProperty(Property p, String o)(Code)
Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  o - The value of the property to be added. This resource to allow cascading calls.



addProperty
public Resource addProperty(Property p, String o, String l)(Code)
Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  o - The value of the property to be added.
Parameters:
  l - the language of the property This resource to allow cascading calls.



addProperty
public Resource addProperty(Property p, String lexicalForm, RDFDatatype datatype)(Code)
Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  lexicalForm - The lexical form of the literal
Parameters:
  datatype - The datatype This resource to allow cascading calls.



addProperty
public Resource addProperty(Property p, RDFNode o)(Code)
Add a property to this resource.

A statement with this resource as the subject, p as the predicate and o as the object is added to the model associated with this resource.


Parameters:
  p - The property to be added.
Parameters:
  o - The value of the property to be added. This resource to allow cascading calls.



begin
public Resource begin()(Code)
Begin a transaction in the associated model. This resource to permit cascading.



commit
public Resource commit()(Code)
Commit the transaction in the associated model. This resource to permit cascading.



equals
public boolean equals(Object o)(Code)
Determine whether two objects represent the same resource.

A resource can only be equal to another resource. If both resources are not anonymous, then they are equal if the URI's are equal. If both resources are anonymous, they are equal only if there Id's are the same. If one resource is anonymous and the other is not, then they are not equal.


Parameters:
  o - The object to be compared. true if and only if both objects are equal



getId
public AnonId getId()(Code)
Returns an a unique identifier for anonymous resources.

The id is unique within the scope of a particular implementation. All models within an implementation will use the same id for the same anonymous resource.

This method is undefined if called on resources which are not anonymous and may raise an exception.

A unique id for an anonymous resource.



getLocalName
public String getLocalName()(Code)
Returns the name of this resource within its namespace. The name of this property within its namespace.



getModel
public Model getModel()(Code)
Return the model associated with this resource. If the Resource was not created by a Model, the result may be null. The model associated with this resource.



getNameSpace
public String getNameSpace()(Code)
Returns the namespace associated with this resource. The namespace for this property.



getNode
public Node getNode()(Code)
Answer the underlying [SPI] Node of this Resource.



getProperty
public Statement getProperty(Property p)(Code)
Answer some statement (this, p, O) in the associated model. If there are several such statements, any one of them may be returned. If no such statements exist, null is returned - in this is differs from getRequiredProperty.
Parameters:
  p - the property sought a statement (this, p, O), or null if no such statements exist here



getRequiredProperty
public Statement getRequiredProperty(Property p)(Code)
Get a property value of this resource.

The model associated with the resource instance is searched for statements whose subject is this resource and whose predicate is p. If such a statement is found, it is returned. If several such statements are found, any one may be returned. If no such statements are found, an exception is thrown.


Parameters:
  p - The property sought. some (this, p, ?O) statement if one exists
throws:
  PropertyNotFoundException - if no such statement found



getURI
public String getURI()(Code)
Return the URI of the resource, or null if it's a bnode. The URI of the resource, or null if it's a bnode.



hasLiteral
public boolean hasLiteral(Property p, boolean o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasLiteral
public boolean hasLiteral(Property p, long o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasLiteral
public boolean hasLiteral(Property p, char o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasLiteral
public boolean hasLiteral(Property p, double o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasLiteral
public boolean hasLiteral(Property p, float o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasLiteral
public boolean hasLiteral(Property p, Object o)(Code)
Answer true iff this resource has the value o for property p. o is interpreted as a typed literal with the appropriate RDF type.



hasProperty
public boolean hasProperty(Property p)(Code)
Determine whether this resource has any values for a given property.
Parameters:
  p - The property sought. true if and only if this resource has at least onevalue for the property.



hasProperty
public boolean hasProperty(Property p, String o)(Code)
Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought. true if and only if this resource has property p withvalue o.



hasProperty
public boolean hasProperty(Property p, String o, String l)(Code)
Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought.
Parameters:
  l - The language of the property sought. true if and only if this resource has property p withvalue o.



hasProperty
public boolean hasProperty(Property p, RDFNode o)(Code)
Test if this resource has a given property with a given value.
Parameters:
  p - The property sought.
Parameters:
  o - The value of the property sought. true if and only if this resource has property p withvalue o.



hasURI
public boolean hasURI(String uri)(Code)
Answer true iff this Resource is a URI resource with the given URI. Using this is preferred to using getURI() and .equals().



listProperties
public StmtIterator listProperties(Property p)(Code)
List all the values of the property p.

Returns an iterator over all the statements in the associated model whose subject is this resource and whose predicate is p.


Parameters:
  p - The predicate sought. An iterator over the statements.



listProperties
public StmtIterator listProperties()(Code)
Return an iterator over all the properties of this resource.

The model associated with this resource is search and an iterator is returned which iterates over all the statements which have this resource as a subject.

An iterator over all the statements about this object.



removeAll
public Resource removeAll(Property p)(Code)
Delete all the statements with predicate p for this resource from its associated model.
Parameters:
  p - the property to remove this resource, to permit cascading



removeProperties
public Resource removeProperties()(Code)
Delete all the properties for this resource from the associated model. This resource to permit cascading.



toString
public String toString()(Code)
Return a string representation of the resource. Returns the URI of the resource unless the resource is anonymous in which case it returns the id of the resource enclosed in square brackets. Return a string representation of the resource.if it is anonymous.



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