📄 model.java
字号:
Remove all the statements in the list from this model, using the bulk
update interface.
@param statements a List of Statements to remove
@return this model, to allow cascading
*/
Model remove( List statements );
/** Add all the statements returned by an iterator to this model.
* @return this model
* @param iter An iterator which returns the statements to be added.
*/
Model add(StmtIterator iter) ;
/** Add all the statements in another model to this model, including the
* reified statements.
* @return this model
* @param m The model whose statements are to be added.
*/
Model add(Model m) ;
/**
Add all the statements of the given model m to this model.
Optionally supress the addition of reified statements.
@param m the model containing the statements to add
@param suppressReifications true to suppress adding reified statements
@return this model for cascading
*/
Model add( Model m, boolean suppressReifications );
/** Add the RDF statements from an XML document.
* Uses content negotiation to request appropriate mime types.
*
* <p>See {@link Model} for a description of how to traverse a firewall.</p>
* @return this model
* @param url of the document containing the RDF statements.
*/
public Model read(String url) ;
/** Add statements from an RDF/XML serialization.
* @param in the source of the RDF/XML
* @param 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 the
* model unconverted.
* @return the current model
*/
public Model read(InputStream in, String base) ;
/** Add RDF statements represented in language <code>lang</code> to the model.
* <br />Predefined values for <code>lang</code> are "RDF/XML", "N-TRIPLE"
* and "N3". <code>null</code> represents the default language, "RDF/XML".
* "RDF/XML-ABBREV" is a synonym for "RDF/XML".
* <br />
*
* @return this model
* @param base the base uri to be used when converting relative
* URI's 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 the
model.
* @param lang the langauge of the serialization <code>null</code>
* selects the default
* @param in the source of the input serialization
*/
public Model read(InputStream in, String base, String lang)
;
/** Using this method is often a mistake.
* Add statements from an RDF/XML serialization.
* It is generally better to use an InputStream if possible.
* {@link Model#read(InputStream,String)}, 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.
* @param reader the source of the RDF/XML
* @param 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 the
model.
* * @return the current model
*/
public Model read(Reader reader, String base) ;
/**
* Add statements from a serializion in language <code>lang</code> to the
* model.
* <br />Predefined values for <code>lang</code> are "RDF/XML", "N-TRIPLE"
* and "N3". <code>null</code> represents the default language, "RDF/XML".
* "RDF/XML-ABBREV" is a synonym for "RDF/XML".
* <br />
*
* <p>See {@link Model} for a description of how to traverse a firewall.</p>
* @param url a string representation of the url to read from
* @param lang the language of the serialization
* @return this model
*/
public Model read(String url, String lang) ;
/** Using this method is often a mistake.
* Add RDF statements represented in language <code>lang</code> to the model.
*<br />
*Predefined values for <code>lang</code> are "RDF/XML", "N-TRIPLE"
*and "N3". <code>null</code> represents the default language, "RDF/XML".
*"RDF/XML-ABBREV" is a synonym for "RDF/XML".
* <br />
* It is generally better to use an InputStream if possible.
* {@link Model#read(InputStream,String)}, 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.
* @return this model
* @param base the base uri to be used when converting relative
* URI's 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 the
model.
* @param lang the langauge of the serialization <code>null</code>
* selects the default
* @param reader the source of the input serialization
*/
public Model read(Reader reader, String base, String lang);
/**
Read into this model the RDF at <code>url</code>, using
<code>baseURI</code> as the base URI if it is non-null. The RDF is assumed
to be RDF/XML unless <code>lang</code> is non-null, in which case it names
the language to be used. Answer this model.
*/
Model read( String url, String base, String lang );
// output operations
/**
* <p>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.
* </p>
*
* @param writer A writer to which the XML will be written
* @return this model
*/
public Model write( Writer writer ) ;
/**
* <p>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.
* </p>
* <p>The language in which to write the model is specified by the
* <code>lang</code> argument. Predefined values are "RDF/XML",
* "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
* represented by <code>null</code> is "RDF/XML".</p>
* @param writer The output writer
* @param lang The output language
* @return this model
*/
public Model write( Writer writer, String lang ) ;
/**
* <p>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.
* </p>
* <p>The language in which to write the model is specified by the
* <code>lang</code> argument. Predefined values are "RDF/XML",
* "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
* represented by <code>null</code>, is "RDF/XML".</p>
* @param writer The output writer
* @param base The base uri for relative URI calculations.
* <code>null</code> means use only absolute URI's.
* @param lang The language in which the RDF should be written
* @return this model
*/
public Model write( Writer writer, String lang, String base );
/**
* <p>Write a serialization of this model as an XML document.
* </p>
* <p>The language in which to write the model is specified by the
* <code>lang</code> argument. Predefined values are "RDF/XML",
* "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is
* represented by <code>null</code> is "RDF/XML".</p>
* @param out The output stream to which the XML will be written
* @return This model
*/
public Model write(OutputStream out) ;
/**
* <p>Write a serialized represention of this model in a specified language.
* </p>
* <p>The language in which to write the model is specified by the
* <code>lang</code> argument. Predefined values are "RDF/XML",
* "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
* represented by <code>null</code>, is "RDF/XML".</p>
* @param out The output stream to which the RDF is written
* @param lang The output langauge
* @return This model
*/
public Model write( OutputStream out, String lang ) ;
/**
* <p>Write a serialized represention of a model in a specified language.
* </p>
* <p>The language in which to write the model is specified by the
* <code>lang</code> argument. Predefined values are "RDF/XML",
* "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
* represented by <code>null</code>, is "RDF/XML".</p>
* @param out The output stream to which the RDF is written
* @param base The base uri to use when writing relative URI's. <code>null</code>
* means use only absolute URI's. This is used for relative
* URIs that would be resolved against the document retrieval URL.
* For some values of <code>lang</code>, this value may be included in the output.
* @param lang The language in which the RDF should be written
* @return This model
*/
public Model write( OutputStream out, String lang, String base );
/** Removes a statement.
*
* <p> The statement with the same subject, predicate and object as
* that supplied will be removed from the model.</p>
* @return this model
* @param s The statement to be removed.
*/
Model remove(Statement s) ;
/** Return a statement with given subject and property.
* <p>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.
* @return A statement from the model with the given subject and property.
* @param s The subject of the statement to be returned.
* @param p The property of the statement to be returned.
* @throws PropertyNotFoundException
*/
Statement getRequiredProperty(Resource s, Property p) ;
/**
Answer a statement (s, p, ?O) from this model. If none exist, return null;
if several exist, pick one arbitrarily.
@param s the subject of the statement to return
@param p the predicate of the statement to return
@return some statement (s, p, ?O) or null if none can be found
*/
Statement getProperty( Resource s, Property p );
/** List all subjects with a given property. .remove() is not implemented on
* this iterator.
* @return an iterator over the subjects
* @param p the property sought.
*/
ResIterator listSubjectsWithProperty(Property p) ;
/** List all subjects with a given property and property value. .remove() is not
* implemented on this iterator.
* @return an iterator over the subjects
* @param p The predicate sought
* @param o The value sought
*/
ResIterator listSubjectsWithProperty(Property p, RDFNode o)
;
/** List all objects in a model.
* @return an iterator over the objects. .remove() is not implemented on this iterator.
*/
NodeIterator listObjects() ;
/** List all objects of a given property. .remove() is not implemented on this iterator.
* @return an iterator over the objects
* @param p The predicate sought
*/
NodeIterator listObjectsOfProperty(Property p) ;
/** List the values of a property of a resource.
* @return an iterator over the objects. .remove() is not implemented on this iterator.
* @param p The predicate sought
*/
NodeIterator listObjectsOfProperty(Resource s, Property p);
/** Determine whether this model contains any statements with a given subject
* and property.
* @return true if there exists within this model a statement with
* subject s and property p, false otherwise
* @param s The subject sought (null for any).
* @param p The predicate sought (null for any).
*/
boolean contains(Resource s, Property p) ;
/**
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)
@param r the RDFNode to be searched for
@return true iff r appears as some subject, predicate, or object
*/
boolean containsResource( RDFNode r );
/** Determine if an (S, P, O) pattern is present in this model, with null allowed
* to represent a wildcard match.
* @return true if the statement with subject s, property p and object o
* is in the model, false otherwise
* @param s The subject of the statment tested (null as wildcard).
* @param p The predicate of the statement tested (null as wildcard).
* @param o The object of the statement tested (null as wildcard).
*/
boolean contains(Resource s, Property p, RDFNode o) ;
/** Determine if a statement is present in this model.
* @param s The statement tested.
* @return true if the statement s is in this model, false otherwise
*/
boolean contains(Statement s) ;
/** Determine if any of the statements returned by an iterator are
* contained in this model.
* @param iter an iterator of the statements to be tested
* @return true if any of the statements returns by iter are contained
* in this model and false otherwise.
*/
boolean containsAny(StmtIterator iter) ;
/** Determine if all of the statements returned by an iterator are
* contained in this model.
* @param iter an iterator of the statements to be tested
* @return true if any of the statements returns by iter are contained
* in this model and false otherwise.
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -