Java Doc for Model.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.Model

All known Subclasses:   com.hp.hpl.jena.mem.ModelMem,  com.hp.hpl.jena.rdf.model.impl.ModelCom,  com.hp.hpl.jena.db.ModelRDB,
Model
public interface Model extends ModelCon,ModelGraphInterface,RDFReaderF,RDFWriterF,PrefixMapping,ModelLock(Code)
An RDF Model.

An RDF model is a set of Statements. Methods are provided for creating resources, properties and literals and the Statements which link them, for adding statements to and removing them from a model, for querying a model and set operations for combining models.

Models may create Resources [URI nodes and bnodes]. Creating a Resource does not make the Resource visible to the model; Resources are only "in" Models if Statements about them are added to the Model. Similarly the only way to "remove" a Resource from a Model is to remove all the Statements that mention it.

When a Resource or Literal is created by a Model, the Model is free to re-use an existing Resource or Literal object with the correct values, or it may create a fresh one. [All Jena RDFNodes and Statements are immutable, so this is generally safe.]

This interface defines a set of primitive methods. A set of convenience methods which extends this interface, e.g. performing automatic type conversions and support for enhanced resources, is defined in ModelCon .

System Properties

Firewalls and Proxies

Some of the methods, e.g. the read methods, may have to traverse a firewall. This can be accomplished using the standard java method of setting system properties. To use a socks proxy, include on the java command line:

-DsocksProxyHost=[your-proxy-domain-name-or-ip-address]

To use an http proxy, include on the command line:

-DproxySet=true -DproxyHost=[your-proxy] -DproxyPort=[your-proxy-port-number]

Alternatively, these properties can be set programatically, e.g.

 System.getProperties().put("proxySet","true");
 System.getProperties().put("proxyHost","proxy.hostname");
 System.getProperties().put("proxyPort",port_number);
 

author:
   bwm
version:
   $Name: $ $Revision: 1.71 $Date: 2008/01/02 12:05:48 $'




Method Summary
 Modelabort()
     Abort the current transaction and abandon any changes in progress.
 Modeladd(Statement s)
     Add a statement to this model.
 Modeladd(Statement[] statements)
     Add all the statements to the Model, using through the bulk update interface.
 Modeladd(List statements)
     add all the statements in the List to this Model, going through the bulk update interface (which means turning them into triples in one form or another).
 Modeladd(StmtIterator iter)
     Add all the statements returned by an iterator to this model.
 Modeladd(Model m)
     Add all the statements in another model to this model, including the reified statements.
 Modeladd(Model m, boolean suppressReifications)
     Add all the statements of the given model m to this model.
 Modelbegin()
     Begin a new transation.
public  voidclose()
     Close the Model and free up resources held.

Not all implementations of Model require this method to be called.

 Modelcommit()
     Commit the current transaction.
 booleancontains(Resource s, Property p)
     Determine whether this model contains any statements with a given subject and property.
 booleancontains(Resource s, Property p, RDFNode o)
     Determine if an (S, P, O) pattern is present in this model, with null allowed to represent a wildcard match.
 booleancontains(Statement s)
     Determine if a statement is present in this model.
Parameters:
  s - The statement tested.
 booleancontainsAll(StmtIterator iter)
     Determine if all of the statements returned by an iterator are contained in this model.
 booleancontainsAll(Model model)
     Determine if all of the statements in a model are also contained in this model.
 booleancontainsAny(StmtIterator iter)
     Determine if any of the statements returned by an iterator are contained in this model.
 booleancontainsAny(Model model)
     Determine if any of the statements in a model are also contained in this model.
 booleancontainsResource(RDFNode r)
     determine if the RDFNode r appears in any statement of this model.
public  RDFListcreateList()
     Answer a new empty list.
public  RDFListcreateList(Iterator members)
    
public  RDFListcreateList(RDFNode[] members)
    
public  LiteralcreateLiteral(String v, String language)
     Create an untyped literal from a String value with a specified language.
public  LiteralcreateLiteral(String v, boolean wellFormed)
     Create a literal from a String value.
public  PropertycreateProperty(String nameSpace, String localName)
     Create a property with a given URI composed from a namespace part and a localname part by concatenating the strings.
 ReifiedStatementcreateReifiedStatement(Statement s)
     Answer a ReifiedStatement that encodes _s_ and belongs to this Model.
 ReifiedStatementcreateReifiedStatement(String uri, Statement s)
     answer a ReifiedStatement that encodes _s_, belongs to this Model, and is a Resource with that _uri_.
public  ResourcecreateResource()
     Create a new anonymous resource whose model is this model.
public  ResourcecreateResource(AnonId id)
     Create a blank node resource with a specified identifier.
public  ResourcecreateResource(String uri)
     Create a new resource associated with this model.
public  StatementcreateStatement(Resource s, Property p, RDFNode o)
     Create a Statement instance.
public  LiteralcreateTypedLiteral(String lex, RDFDatatype dtype)
     Build a typed literal from its lexical form.
public  LiteralcreateTypedLiteral(Object value, RDFDatatype dtype)
     Build a typed literal from its value form.

Note that in preview releases of Jena2 it was also possible to specify a language type.

public  LiteralcreateTypedLiteral(Object value)
     Build a typed literal label from its value form using whatever datatype is currently registered as the the default representation for this java class.
 Modeldifference(Model model)
     Create a new, independant, model containing all the statements in this model which are not in another.
public  booleanequals(Object m)
     Test whether the given object m is a model that is equal to this model, which is true iff the underlying graphs are identical Java objects.
 ObjectexecuteInTransaction(Command cmd)
     Execute the command cmd inside a transaction.
 ResourcegetAnyReifiedStatement(Statement s)
     Find or create a ReifiedStatement corresponding to a Statement.
public  LockgetLock()
     Get the model lock for this model.
 PropertygetProperty(String nameSpace, String localName)
     Return a Property instance with the given URI in this model.
 StatementgetProperty(Resource s, Property p)
     Answer a statement (s, p, ?O) from this model.
 ReificationStylegetReificationStyle()
     Answer the reification style of the model.
 StatementgetRequiredProperty(Resource s, Property p)
     Return a statement with given subject and property.

If more than one statement witht the given subject and property exists in the model, it is undefined which will be returned.

 ResourcegetResource(String uri)
     Return a Resource instance with the given URI in this model.
 booleanindependent()
     Determine whether this model is independent.

For efficiency reasons, some implementations may create models which which are dependent on others, i.e.

 Modelintersection(Model model)
     Create a new, independant, model containing all the statements which are in both this model and another.
public  booleanisClosed()
     Answer true iff .close() has been called on this Model.
 booleanisEmpty()
     Answer true iff the model contains no explicit statements (ie it's size is zero, listStatements() would deliver the empty iterator).
 booleanisIsomorphicWith(Model g)
     Compare this Model with another for equality ignoring the labels on bNodes. See RDF Concepts.

Two models are isomorphic when each statement in one can be matched with a statement in the other.

 booleanisReified(Statement s)
     Determine if this Statement has been reified in this Model.
Parameters:
  s - The statement tested.
 NsIteratorlistNameSpaces()
     (You probably don't want this method; more likely you want the PrefixMapping methods that Model supports.) List the namespaces used by predicates and types in the model.
 NodeIteratorlistObjects()
     List all objects in a model. an iterator over the objects.
 NodeIteratorlistObjectsOfProperty(Property p)
     List all objects of a given property.
 NodeIteratorlistObjectsOfProperty(Resource s, Property p)
     List the values of a property of a resource. an iterator over the objects.
 RSIteratorlistReifiedStatements()
    
 RSIteratorlistReifiedStatements(Statement st)
     answer an iterator delivering all the reified statements "in" this model that match the statement _st_.
 ResIteratorlistResourcesWithProperty(Property p)
     Answer an iterator [with no duplicates] over all the resources in this model that have property p.
 ResIteratorlistResourcesWithProperty(Property p, RDFNode o)
     Answer an iterator [with no duplicates] over all the resources in this model that have property p with value o. remove() is not implemented on this iterator.
 StmtIteratorlistStatements()
     List all statements.
 StmtIteratorlistStatements(Selector s)
     List the statements matching a selector.
 StmtIteratorlistStatements(Resource s, Property p, RDFNode o)
     Find all the statements matching a pattern.

Return an iterator over all the statements in a model that match a pattern.

 ResIteratorlistSubjects()
     List all resources which are subjects of statements.

Subsequent operations on those resource may modify this model.

an iterator over a set of resources which are subjects of statementsin the model.
 ResIteratorlistSubjectsWithProperty(Property p)
     An alias for istResourcesWithProperty(Property), retained for backward compatability.
 ResIteratorlistSubjectsWithProperty(Property p, RDFNode o)
     An alias for listResourcesWithProperty, retained for backward compatability.
public  ModelnotifyEvent(Object e)
     Notify any listeners that the event e has occurred.
 Modelquery(Selector s)
     Create a new model containing the statements matching a query.
public  Modelread(String url)
     Add the RDF statements from an XML document.
public  Modelread(InputStream in, String base)
     Add statements from an RDF/XML serialization.
Parameters:
  in - the source of the RDF/XML
Parameters:
  base - the base to use when converting relative to absolute uri's.The base URI may be null if there are no relative URIs to convert.A base URI of "" may permit relative URIs to be used in themodel unconverted.
public  Modelread(InputStream in, String base, String lang)
     Add RDF statements represented in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3".
public  Modelread(Reader reader, String base)
     Using this method is often a mistake. Add statements from an RDF/XML serialization. It is generally better to use an InputStream if possible. Model.read(InputStreamString) , otherwise there is a danger of a mismatch between the character encoding of say the FileReader and the character encoding of the data in the file.
Parameters:
  reader - the source of the RDF/XML
Parameters:
  base - the base to use when converting relative to absolute uri's.The base URI may be null if there are no relative URIs toconvert.A base URI of "" may permit relative URIs to be used in themodel.
public  Modelread(String url, String lang)
     Add statements from a serializion in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3".
public  Modelread(Reader reader, String base, String lang)
     Using this method is often a mistake. Add RDF statements represented in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3".
 Modelread(String url, String base, String lang)
     Read into this model the RDF at url, using baseURI as the base URI if it is non-null.
public  Modelregister(ModelChangedListener listener)
     Register a listener for model-changed events on this model.
 Modelremove(Statement[] statements)
     Remove all the statements from the Model, using the bulk update interface.
 Modelremove(List statements)
     Remove all the statements in the list from this model, using the bulk update interface.
 Modelremove(Statement s)
     Removes a statement.
public  ModelremoveAll()
     Remove all the statements from this model.
public  ModelremoveAll(Resource s, Property p, RDFNode r)
     Remove all the statements matching (s, p, o) from this model.
 voidremoveAllReifications(Statement s)
     Remove all reifications (ie implicit reification quads) of _s_.
 voidremoveReification(ReifiedStatement rs)
     Remove a particular reificiation.
 longsize()
     size will return the number of statements in a concrete model, for a virtualized model such as one created by an inference engine, it will return an estimated lower bound for the numberof statements in the model but it is possible for a subsequent listStatements on such a model to discover more statements than size() indicated.
 booleansupportsSetOperations()
     Determine whether this model supports set operations.
 booleansupportsTransactions()
     Determine whether this model supports transactions.
 Modelunion(Model model)
     Create a new, independant, model containing all the statements in this model together with all of those in another given model.
public  Modelunregister(ModelChangedListener listener)
     Unregister a listener from model-changed events on this model.
public  Modelwrite(Writer writer)
    

Write the model as an XML document.

public  Modelwrite(Writer writer, String lang)
    

Write a serialized represention of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

The language in which to write the model is specified by the lang argument.

public  Modelwrite(Writer writer, String lang, String base)
    

Write a serialized represention of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

The language in which to write the model is specified by the lang argument.

public  Modelwrite(OutputStream out)
    

Write a serialization of this model as an XML document.

The language in which to write the model is specified by the lang argument.

public  Modelwrite(OutputStream out, String lang)
    

Write a serialized represention of this model in a specified language.

The language in which to write the model is specified by the lang argument.

public  Modelwrite(OutputStream out, String lang, String base)
    

Write a serialized represention of a model in a specified language.

The language in which to write the model is specified by the lang argument.




Method Detail
abort
Model abort()(Code)
Abort the current transaction and abandon any changes in progress. this model to enable cascading.



add
Model add(Statement s)(Code)
Add a statement to this model. This model.
Parameters:
  s - The statement to be added.



add
Model add(Statement[] statements)(Code)
Add all the statements to the Model, using through the bulk update interface.
Parameters:
  statements - the array of statements to add this model, to allow cascading



add
Model add(List statements)(Code)
add all the statements in the List to this Model, going through the bulk update interface (which means turning them into triples in one form or another).
Parameters:
  statements - a List of Statements this model, to allow cascading



add
Model add(StmtIterator iter)(Code)
Add all the statements returned by an iterator to this model. this model
Parameters:
  iter - An iterator which returns the statements to be added.



add
Model add(Model m)(Code)
Add all the statements in another model to this model, including the reified statements. this model
Parameters:
  m - The model whose statements are to be added.



add
Model add(Model m, boolean suppressReifications)(Code)
Add all the statements of the given model m to this model. Optionally supress the addition of reified statements.
Parameters:
  m - the model containing the statements to add
Parameters:
  suppressReifications - true to suppress adding reified statements this model for cascading



begin
Model begin()(Code)
Begin a new transation.

All changes made to a model within a transaction, will either be made, or none of them will be made.

this model to enable cascading.



close
public void close()(Code)
Close the Model and free up resources held.

Not all implementations of Model require this method to be called. But some do, so in general its best to call it when done with the object, rather than leave it to the finalizer.




commit
Model commit()(Code)
Commit the current transaction. this model to enable cascading.



contains
boolean contains(Resource s, Property p)(Code)
Determine whether this model contains any statements with a given subject and property. true if there exists within this model a statement withsubject s and property p, false otherwise
Parameters:
  s - The subject sought (null for any).
Parameters:
  p - The predicate sought (null for any).



contains
boolean contains(Resource s, Property p, RDFNode o)(Code)
Determine if an (S, P, O) pattern is present in this model, with null allowed to represent a wildcard match. true if the statement with subject s, property p and object ois in the model, false otherwise
Parameters:
  s - The subject of the statment tested (null as wildcard).
Parameters:
  p - The predicate of the statement tested (null as wildcard).
Parameters:
  o - The object of the statement tested (null as wildcard).



contains
boolean contains(Statement s)(Code)
Determine if a statement is present in this model.
Parameters:
  s - The statement tested. true if the statement s is in this model, false otherwise



containsAll
boolean containsAll(StmtIterator iter)(Code)
Determine if all of the statements returned by an iterator are contained in this model.
Parameters:
  iter - an iterator of the statements to be tested true if any of the statements returns by iter are containedin this model and false otherwise.



containsAll
boolean containsAll(Model model)(Code)
Determine if all of the statements in a model are also contained in this model.
Parameters:
  model - the model containing the statements to be tested true if all of the statements in model are also containedin this model and false otherwise.



containsAny
boolean containsAny(StmtIterator iter)(Code)
Determine if any of the statements returned by an iterator are contained in this model.
Parameters:
  iter - an iterator of the statements to be tested true if any of the statements returns by iter are containedin this model and false otherwise.



containsAny
boolean containsAny(Model model)(Code)
Determine if any of the statements in a model are also contained in this model.
Parameters:
  model - the model containing the statements to be tested true if any of the statements in model are also containedin this model and false otherwise.



containsResource
boolean containsResource(RDFNode r)(Code)
determine if the RDFNode r appears in any statement of this model. (containsRDFNode is a horrible name, and in any case, even literals will be resources one day)
Parameters:
  r - the RDFNode to be searched for true iff r appears as some subject, predicate, or object



createList
public RDFList createList()(Code)
Answer a new empty list. This is equivalent to a list consisting only of rdf:nil. An RDF-encoded list of no elements



createList
public RDFList createList(Iterator members)(Code)

Answer a new list containing the resources from the given iterator, in order.


Parameters:
  members - An iterator, each value of which is expected to be an RDFNode An RDF-encoded list of the elements of the iterator



createList
public RDFList createList(RDFNode[] members)(Code)

Answer a new list containing the nodes from the given array, in order


Parameters:
  members - An array of RDF nodes that will be the members of the list An RDF-encoded list



createLiteral
public Literal createLiteral(String v, String language)(Code)
Create an untyped literal from a String value with a specified language.
Parameters:
  v - the lexical form of the literal
Parameters:
  language - the language associated with the literal a new literal representing the value v with the given language



createLiteral
public Literal createLiteral(String v, boolean wellFormed)(Code)
Create a literal from a String value. An existing literal of the right value may be returned, or a fresh one created. The use of the wellFormed flag is to create typed literals of type rdf:XMLLiteral, without error checking. This should only be use when the lexical form is known to already be in exclusive canonical XML.
Parameters:
  v - the lexical form of the literal
Parameters:
  wellFormed - true if the Literal is well formed XML, in the lexical space of rdf:XMLLiteral a new literal



createProperty
public Property createProperty(String nameSpace, String localName)(Code)
Create a property with a given URI composed from a namespace part and a localname part by concatenating the strings.

This method may return an existing property with the correct URI and model, or it may construct a fresh one, as it sees fit.

Subsequent operations on the returned property may modify this model.
Parameters:
  nameSpace - the nameSpace of the property
Parameters:
  localName - the name of the property within its namespace a property instance




createReifiedStatement
ReifiedStatement createReifiedStatement(Statement s)(Code)
Answer a ReifiedStatement that encodes _s_ and belongs to this Model.
result.getModel() == this
result.getStatement() .equals ( s )



createReifiedStatement
ReifiedStatement createReifiedStatement(String uri, Statement s)(Code)
answer a ReifiedStatement that encodes _s_, belongs to this Model, and is a Resource with that _uri_.



createResource
public Resource createResource()(Code)
Create a new anonymous resource whose model is this model. This bnode will have a new AnonId distinct from any allocated by any other call of this method.

Subsequent operations on the returned resource may modify this model. a new anonymous resource linked to this model.




createResource
public Resource createResource(AnonId id)(Code)
Create a blank node resource with a specified identifier. The resulting bnode will be equal to any other bnode with the same AnonId (even if they are in separate models - be warned). The intended use for this method is to allow bnode round-tripping between Jena models and other representations.

This method may return an existing bnode with the correct AnonId and model, or it may construct a fresh one, as it sees fit.

Operations on the result may modify this model
Parameters:
  id - the identifier to use for this blank node a blank node with that identifier




createResource
public Resource createResource(String uri)(Code)
Create a new resource associated with this model. If the uri string is null, this creates a bnode, as per createResource(). Otherwise it creates a URI node. A URI resource is .equals() to any other URI Resource with the same URI (even in a different model - be warned).

This method may return an existing Resource with the correct URI and model, or it may construct a fresh one, as it sees fit.

Operations on the result Resource may change this model.
Parameters:
  uri - the URI of the resource to be created a new resource linked to this model.




createStatement
public Statement createStatement(Resource s, Property p, RDFNode o)(Code)
Create a Statement instance. (Creating a statement does not add it to the set of statements in the model; see Model::add). This method may return an existing Statement with the correct components and model, or it may construct a fresh one, as it sees fit.

Subsequent operations on the statement or any of its parts may modify this model.
Parameters:
  s - the subject of the statement
Parameters:
  p - the predicate of the statement
Parameters:
  o - the object of the statement the new statement




createTypedLiteral
public Literal createTypedLiteral(String lex, RDFDatatype dtype)(Code)
Build a typed literal from its lexical form. The lexical form will be parsed now and the value stored. If the form is not legal this will throw an exception.

Note that in preview releases of Jena2 it was also possible to specify a language type. Changes to the RDF specification mean that this is no longer legal except for plain literals. To create a plain literal with a language tag use Model.createLiteral(String,String) createLiteral .
Parameters:
  lex - the lexical form of the literal
Parameters:
  dtype - the type of the literal, null for old style "plain" literals
throws:
  DatatypeFormatException - if lex is not a legal form of dtype




createTypedLiteral
public Literal createTypedLiteral(Object value, RDFDatatype dtype)(Code)
Build a typed literal from its value form.

Note that in preview releases of Jena2 it was also possible to specify a language type. Changes to the RDF specification mean that this is no longer legal except for plain literals. To create a plain literal with a language tag use Model.createLiteral(String,String) createLiteral .


Parameters:
  value - the value of the literal
Parameters:
  dtype - the type of the literal, null for old style "plain" literals



createTypedLiteral
public Literal createTypedLiteral(Object value)(Code)
Build a typed literal label from its value form using whatever datatype is currently registered as the the default representation for this java class. No language tag is supplied.
Parameters:
  value - the literal value to encapsulate



difference
Model difference(Model model)(Code)
Create a new, independant, model containing all the statements in this model which are not in another. The new model need not be of the same type as either this model or the argument model: typically it will be a memory-based model. a new model containing all the statements in this model thatare not in the given model.
Parameters:
  model - the other model whose statements are to be excluded.



equals
public boolean equals(Object m)(Code)
Test whether the given object m is a model that is equal to this model, which is true iff the underlying graphs are identical Java objects. This is not the same test as comparing whether two models have the same structure (i.e. contain the same set of statements). To test for strucutural equivalence, see Model.isIsomorphicWith .
Parameters:
  m - the model to be compared true if m shares a graph object with this model
See Also:   Model.isIsomorphicWith(Model)



executeInTransaction
Object executeInTransaction(Command cmd)(Code)
Execute the command cmd inside a transaction. If it completes, commit the transaction and return the result; if it fails (by throwing an exception), abort the transaction and throw an exception.



getAnyReifiedStatement
Resource getAnyReifiedStatement(Statement s)(Code)
Find or create a ReifiedStatement corresponding to a Statement.
Parameters:
  s - Statement which may or may not already be reified a Resource [ReifiedStatement] that reifies the specified Statement.



getLock
public Lock getLock()(Code)
Get the model lock for this model. See also the convenience operations enterCriticalSection and leaveCriticalSection.
See Also:   ModelLock The ModelLock object associated with this model



getProperty
Property getProperty(String nameSpace, String localName)(Code)
Return a Property instance with the given URI in this model. This method behaves identically to createProperty(String,String) and exists as legacy: createProperty is now capable of, and allowed to, reuse existing objects.

Subsequent operations on the returned property may modify this model. a property linked to this model
Parameters:
  nameSpace - the RDF namespace of the property
Parameters:
  localName - the localName of the property in its namespace




getProperty
Statement getProperty(Resource s, Property p)(Code)
Answer a statement (s, p, ?O) from this model. If none exist, return null; if several exist, pick one arbitrarily.
Parameters:
  s - the subject of the statement to return
Parameters:
  p - the predicate of the statement to return some statement (s, p, ?O) or null if none can be found



getReificationStyle
ReificationStyle getReificationStyle()(Code)
Answer the reification style of the model. the reification style



getRequiredProperty
Statement getRequiredProperty(Resource s, Property p)(Code)
Return a statement with given subject and property.

If more than one statement witht the given subject and property exists in the model, it is undefined which will be returned. If none exist, an exception is thrown. A statement from the model with the given subject and property.
Parameters:
  s - The subject of the statement to be returned.
Parameters:
  p - The property of the statement to be returned.
throws:
  PropertyNotFoundException -




getResource
Resource getResource(String uri)(Code)
Return a Resource instance with the given URI in this model. This method behaves identically to createResource(String) and exists as legacy: createResource is now capable of, and allowed to, reuse existing objects.

Subsequent operations on the returned object may modify this model. a resource instance
Parameters:
  uri - the URI of the resource




independent
boolean independent()(Code)
Determine whether this model is independent.

For efficiency reasons, some implementations may create models which which are dependent on others, i.e. a change in one model may cause a change in another. If this is the case this method will return false, otherwise it will return true.

true if this model is indepdent of others



intersection
Model intersection(Model model)(Code)
Create a new, independant, model containing all the statements which are in both this model and another. As models are sets of statements, a statement contained in both models will only appear once in the resulting model. The new model need not be of the same type as either this model or the argument model: typically it will be a memory-based model. A new model containing all the statements that are in both models.
Parameters:
  model - The other model.



isClosed
public boolean isClosed()(Code)
Answer true iff .close() has been called on this Model.



isEmpty
boolean isEmpty()(Code)
Answer true iff the model contains no explicit statements (ie it's size is zero, listStatements() would deliver the empty iterator). true iff the model contains no explicit statements.



isIsomorphicWith
boolean isIsomorphicWith(Model g)(Code)
Compare this Model with another for equality ignoring the labels on bNodes. See RDF Concepts.

Two models are isomorphic when each statement in one can be matched with a statement in the other. Statements which are identical match.

Special treatment is given to anonymous nodes. A binding is a one to one mapping which maps each anonymous node in this model to an anonymous node in model. Two statements s1 and s2 match under a binding if if s1.subject is anonymous and s2.subject is anonymous and the binding maps s1.subject to s2.subject.

Two models are isomorphic if there is a binding that allows all the statements in one model to match a a statement in the other.


Parameters:
  g - Compare against this. boolean True if the two RDF graphs are isomorphic.



isReified
boolean isReified(Statement s)(Code)
Determine if this Statement has been reified in this Model.
Parameters:
  s - The statement tested. true iff a ReifiedStatement(s) has been created in this model



listNameSpaces
NsIterator listNameSpaces()(Code)
(You probably don't want this method; more likely you want the PrefixMapping methods that Model supports.) List the namespaces used by predicates and types in the model. This method is really intended for use by the RDF/XML writer, which needs to know these namespaces to generate correct and vaguely pretty XML.

The namespaces returned are those of (a) every URI used as a property in the model and (b) those of every URI that appears as the object of an rdf:type statement.

Note that the notion of "namespace" used here is not that of an XML prefix-namespace, but just of the minimal legal left part of a URI (see Util.splitNamespace for details). If you want the RDF/XML (or N3) namespaces, treat the Model as a PrefixMapping.
See Also:   com.hp.hpl.jena.shared.PrefixMapping an iterator over every predicate and type namespace




listObjects
NodeIterator listObjects()(Code)
List all objects in a model. an iterator over the objects. .remove() is not implemented on this iterator.



listObjectsOfProperty
NodeIterator listObjectsOfProperty(Property p)(Code)
List all objects of a given property. .remove() is not implemented on this iterator. an iterator over the objects
Parameters:
  p - The predicate sought



listObjectsOfProperty
NodeIterator listObjectsOfProperty(Resource s, Property p)(Code)
List the values of a property of a resource. an iterator over the objects. .remove() is not implemented on this iterator.
Parameters:
  p - The predicate sought



listReifiedStatements
RSIterator listReifiedStatements()(Code)
answer an iterator delivering all the reified statements "in" this model



listReifiedStatements
RSIterator listReifiedStatements(Statement st)(Code)
answer an iterator delivering all the reified statements "in" this model that match the statement _st_.



listResourcesWithProperty
ResIterator listResourcesWithProperty(Property p)(Code)
Answer an iterator [with no duplicates] over all the resources in this model that have property p. remove() is not implemented on this iterator.



listResourcesWithProperty
ResIterator listResourcesWithProperty(Property p, RDFNode o)(Code)
Answer an iterator [with no duplicates] over all the resources in this model that have property p with value o. remove() is not implemented on this iterator.



listStatements
StmtIterator listStatements()(Code)
List all statements.

Subsequent operations on those statements may modify this model.

an iterator over all statements in the model.



listStatements
StmtIterator listStatements(Selector s)(Code)
List the statements matching a selector.

A statment is considered to match if the test method of s returns true when called on s.

an iterator over the matching statements
Parameters:
  s - A selector object..



listStatements
StmtIterator listStatements(Resource s, Property p, RDFNode o)(Code)
Find all the statements matching a pattern.

Return an iterator over all the statements in a model that match a pattern. The statements selected are those whose subject matches the subject argument, whose predicate matches the predicate argument and whose object matches the object argument. If an argument is null it matches anything.

an iterator over the subjects
Parameters:
  s - The subject sought
Parameters:
  p - The predicate sought
Parameters:
  o - The value sought



listSubjects
ResIterator listSubjects()(Code)
List all resources which are subjects of statements.

Subsequent operations on those resource may modify this model.

an iterator over a set of resources which are subjects of statementsin the model. .remove() is not implemented on this iterator.



listSubjectsWithProperty
ResIterator listSubjectsWithProperty(Property p)(Code)
An alias for istResourcesWithProperty(Property), retained for backward compatability. It may be deprecated in later releases.



listSubjectsWithProperty
ResIterator listSubjectsWithProperty(Property p, RDFNode o)(Code)
An alias for listResourcesWithProperty, retained for backward compatability. It may be deprecated in later releases.



notifyEvent
public Model notifyEvent(Object e)(Code)
Notify any listeners that the event e has occurred.
Parameters:
  e - the event that has occurred



query
Model query(Selector s)(Code)
Create a new model containing the statements matching a query.

A statment is considered to match if the test method of s returns true when called on s.

an iterator over the matching statements
Parameters:
  s - A selector object..



read
public Model read(String url)(Code)
Add the RDF statements from an XML document. Uses content negotiation to request appropriate mime types.

See Model for a description of how to traverse a firewall.

this model
Parameters:
  url - of the document containing the RDF statements.



read
public Model read(InputStream in, String base)(Code)
Add statements from an RDF/XML serialization.
Parameters:
  in - the source of the RDF/XML
Parameters:
  base - the base to use when converting relative to absolute uri's.The base URI may be null if there are no relative URIs to convert.A base URI of "" may permit relative URIs to be used in themodel unconverted. the current model



read
public Model read(InputStream in, String base, String lang)(Code)
Add RDF statements represented in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML".
this model
Parameters:
  base - the base uri to be used when converting relativeURI's to absolute URI's.The base URI may be null if there are no relative URIs toconvert.A base URI of "" may permit relative URIs to be used in themodel.
Parameters:
  lang - the langauge of the serialization nullselects the default
Parameters:
  in - the source of the input serialization



read
public Model read(Reader reader, String base)(Code)
Using this method is often a mistake. Add statements from an RDF/XML serialization. It is generally better to use an InputStream if possible. Model.read(InputStreamString) , otherwise there is a danger of a mismatch between the character encoding of say the FileReader and the character encoding of the data in the file.
Parameters:
  reader - the source of the RDF/XML
Parameters:
  base - the base to use when converting relative to absolute uri's.The base URI may be null if there are no relative URIs toconvert.A base URI of "" may permit relative URIs to be used in themodel. the current model



read
public Model read(String url, String lang)(Code)
Add statements from a serializion in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML".

See Model for a description of how to traverse a firewall.


Parameters:
  url - a string representation of the url to read from
Parameters:
  lang - the language of the serialization this model



read
public Model read(Reader reader, String base, String lang)(Code)
Using this method is often a mistake. Add RDF statements represented in language lang to the model.
Predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML".
It is generally better to use an InputStream if possible. Model.read(InputStreamString) , otherwise there is a danger of a mismatch between the character encoding of say the FileReader and the character encoding of the data in the file. this model
Parameters:
  base - the base uri to be used when converting relativeURI's to absolute URI's.The base URI may be null if there are no relative URIs toconvert.A base URI of "" may permit relative URIs to be used in themodel.
Parameters:
  lang - the langauge of the serialization nullselects the default
Parameters:
  reader - the source of the input serialization



read
Model read(String url, String base, String lang)(Code)
Read into this model the RDF at url, using baseURI as the base URI if it is non-null. The RDF is assumed to be RDF/XML unless lang is non-null, in which case it names the language to be used. Answer this model.



register
public Model register(ModelChangedListener listener)(Code)
Register a listener for model-changed events on this model. The methods on the listener will be called when API add/remove calls on the model succeed [in whole or in part].

The same listener may be registered many times; if so, it's methods will be called as many times as it's registered for each event.
See Also:   ModelChangedListener this model, for cascading




remove
Model remove(Statement[] statements)(Code)
Remove all the statements from the Model, using the bulk update interface.
Parameters:
  statements - the array of statements to be added this model, to allow cascading



remove
Model remove(List statements)(Code)
Remove all the statements in the list from this model, using the bulk update interface.
Parameters:
  statements - a List of Statements to remove this model, to allow cascading



remove
Model remove(Statement s)(Code)
Removes a statement.

The statement with the same subject, predicate and object as that supplied will be removed from the model.

this model
Parameters:
  s - The statement to be removed.



removeAll
public Model removeAll()(Code)
Remove all the statements from this model.



removeAll
public Model removeAll(Resource s, Property p, RDFNode r)(Code)
Remove all the statements matching (s, p, o) from this model.



removeAllReifications
void removeAllReifications(Statement s)(Code)
Remove all reifications (ie implicit reification quads) of _s_.



removeReification
void removeReification(ReifiedStatement rs)(Code)
Remove a particular reificiation.



size
long size()(Code)
size will return the number of statements in a concrete model, for a virtualized model such as one created by an inference engine, it will return an estimated lower bound for the numberof statements in the model but it is possible for a subsequent listStatements on such a model to discover more statements than size() indicated. the number of statements in a concrete model or an estimatedlower bound on the number of statements in an virtualized model



supportsSetOperations
boolean supportsSetOperations()(Code)
Determine whether this model supports set operations. true if this model supports set operations.



supportsTransactions
boolean supportsTransactions()(Code)
Determine whether this model supports transactions. true if this model supports transactions.



union
Model union(Model model)(Code)
Create a new, independant, model containing all the statements in this model together with all of those in another given model. By independant we mean that changes to the result model do not affect the operand models, and vice versa.

The new model need not be of the same type as either this model or the argument model: typically it will be a memory-based model, even if this model is a database model. A new model containing all the statements that are in either model
Parameters:
  model - The other model whose statements are to be included.




unregister
public Model unregister(ModelChangedListener listener)(Code)
Unregister a listener from model-changed events on this model. The listener is dtached from the model. The model is returned to permit cascading. If the listener is not attached to the model, then nothing happens.
See Also:   ModelChangedListener this model, for cascading



write
public Model write(Writer writer)(Code)

Write the model as an XML document. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.


Parameters:
  writer - A writer to which the XML will be written this model



write
public Model write(Writer writer, String lang)(Code)

Write a serialized represention of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value, represented by null is "RDF/XML".


Parameters:
  writer - The output writer
Parameters:
  lang - The output language this model



write
public Model write(Writer writer, String lang, String base)(Code)

Write a serialized represention of a model in a specified language. It is often better to use an OutputStream rather than a Writer, since this will avoid character encoding errors.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value, represented by null, is "RDF/XML".


Parameters:
  writer - The output writer
Parameters:
  base - The base uri for relative URI calculations.null means use only absolute URI's.
Parameters:
  lang - The language in which the RDF should be written this model



write
public Model write(OutputStream out)(Code)

Write a serialization of this model as an XML document.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is represented by null is "RDF/XML".


Parameters:
  out - The output stream to which the XML will be written This model



write
public Model write(OutputStream out, String lang)(Code)

Write a serialized represention of this model in a specified language.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value, represented by null, is "RDF/XML".


Parameters:
  out - The output stream to which the RDF is written
Parameters:
  lang - The output langauge This model



write
public Model write(OutputStream out, String lang, String base)(Code)

Write a serialized represention of a model in a specified language.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value, represented by null, is "RDF/XML".


Parameters:
  out - The output stream to which the RDF is written
Parameters:
  base - The base uri to use when writing relative URI's. nullmeans use only absolute URI's. This is used for relativeURIs that would be resolved against the document retrieval URL.For some values of lang, this value may be included in the output.
Parameters:
  lang - The language in which the RDF should be written This model



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