| java.lang.Object com.hp.hpl.jena.enhanced.Polymorphic com.hp.hpl.jena.enhanced.EnhGraph com.hp.hpl.jena.rdf.model.impl.ModelCom
All known Subclasses: com.hp.hpl.jena.mem.ModelMem, com.hp.hpl.jena.db.ModelRDB, com.hp.hpl.jena.rdf.model.impl.InfModelImpl, com.hp.hpl.jena.ontology.impl.OntModelImpl, com.hp.hpl.jena.util.MonitorModel,
ModelCom | public class ModelCom extends EnhGraph implements Model,PrefixMapping,ModelLock(Code) | | Common methods for model implementations.
This class implements common methods, mainly convenience methods, for
model implementations. It is intended use is as a base class from which
model implemenations can be derived.
author: bwm author: hacked by Jeremy, tweaked by Chris (May 2002 - October 2002) |
Method Summary | |
public Model | abort() | public GraphListener | adapt(ModelChangedListener L) Answer a GraphListener that, when fed graph-level update events,
fires the corresponding model-level event handlers in L . | public Model | add(Resource s, Property p, String o) | public Model | add(Resource s, Property p, String o, boolean wellFormed) | public Model | add(Resource s, Property p, String o, String lang, boolean wellFormed) | public Model | add(Resource s, Property p, String lex, RDFDatatype datatype) | public Model | add(Resource s, Property p, String o, String l) | public Model | add(StmtIterator iter) | public Model | add(Model m) | public Model | add(Model m, boolean suppressReifications) | public Model | add(Statement s) add a Statement to this Model by adding its SPO components. | public Model | add(Statement[] statements) Add all the statements to the model by converting them to an array of corresponding
triples and removing those from the underlying graph. | public Model | add(List statements) Add all the statements to the model by converting the list to an array of
Statement and removing that. | public Model | add(Resource s, Property p, RDFNode o) | protected static Model | addCommon(Model result, StmtIterator it, Model other) Answer the argument result with all the statements from the statement iterator that
are in the other model added to it. | public Model | addLiteral(Resource s, Property p, boolean o) | public Model | addLiteral(Resource s, Property p, long o) | public Model | addLiteral(Resource s, Property p, int o) | public Model | addLiteral(Resource s, Property p, char o) | public Model | addLiteral(Resource s, Property p, float o) | public Model | addLiteral(Resource s, Property p, double o) | public Model | addLiteral(Resource s, Property p, Object o) | public static void | addNamespaces(Model m, Map ns) Service method to update the namespaces of a Model given the
mappings from prefix names to sets of URIs. | public Model | addTyped(Resource s, Property p, boolean o) | public Filter | asFilter(Selector s) Answer a Filter that filters exactly those things the Selector selects. | public Model | asModel(Graph g) | public static Node | asNode(RDFNode x) | public RDFNode | asRDFNode(Node n) | public Statement | asStatement(Triple t) Answer a Statement in this Model whcih encodes the given Triple. | public Statement[] | asStatements(Triple[] triples) | public List | asStatements(List triples) | public StmtIterator | asStatements(Iterator it) | public Model | begin() | public void | close() | public Model | commit() | public boolean | contains(Resource s, Property p, String o) | public boolean | contains(Resource s, Property p, String o, String l) | public boolean | contains(Statement s) | public boolean | contains(Resource s, Property p) | public boolean | contains(Resource s, Property p, RDFNode o) | public boolean | containsAll(Model model) | public boolean | containsAll(StmtIterator iter) | protected boolean | containsAllThenClose(StmtIterator iter) | public boolean | containsAny(Model model) | public boolean | containsAny(StmtIterator iter) | protected boolean | containsAnyThenClose(StmtIterator iter) | public boolean | containsLiteral(Resource s, Property p, boolean o) | public boolean | containsLiteral(Resource s, Property p, long o) | public boolean | containsLiteral(Resource s, Property p, int o) | public boolean | containsLiteral(Resource s, Property p, char o) | public boolean | containsLiteral(Resource s, Property p, float o) | public boolean | containsLiteral(Resource s, Property p, double o) | public boolean | containsLiteral(Resource s, Property p, Object o) | public boolean | containsResource(RDFNode r) | public boolean | containsTyped(Resource s, Property p, boolean o) | public Alt | createAlt() | public Alt | createAlt(String uri) | public Bag | createBag() | public Bag | createBag(String uri) | public RDFList | createList() | public RDFList | createList(Iterator members) 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. | public RDFList | createList(RDFNode[] members) | public Literal | createLiteral(String v) | public Literal | createLiteral(String v, String l) | public Literal | createLiteral(String v, boolean wellFormed) | public Literal | createLiteral(String v, String l, boolean wellFormed) | public Statement | createLiteralStatement(Resource r, Property p, boolean o) | public Statement | createLiteralStatement(Resource r, Property p, long o) | public Statement | createLiteralStatement(Resource r, Property p, int o) | public Statement | createLiteralStatement(Resource r, Property p, char o) | public Statement | createLiteralStatement(Resource r, Property p, float o) | public Statement | createLiteralStatement(Resource r, Property p, double o) | public Statement | createLiteralStatement(Resource r, Property p, Object o) | public Property | createProperty(String uri) | public Property | createProperty(String nameSpace, String localName) | public ReifiedStatement | createReifiedStatement(Statement s) create a ReifiedStatement that encodes _s_ and belongs to this Model. | public ReifiedStatement | createReifiedStatement(String uri, Statement s) | public Resource | createResource(Resource type) | public Resource | createResource(String uri, Resource type) | public Resource | createResource(ResourceF f) | public Resource | createResource(AnonId id) | public Resource | createResource(String uri, ResourceF f) | public Resource | createResource() | public Resource | createResource(String uri) | public Seq | createSeq() | public Seq | createSeq(String uri) | public Statement | createStatement(Resource r, Property p, String o) | public Statement | createStatement(Resource r, Property p, String o, boolean wellFormed) | public Statement | createStatement(Resource r, Property p, String o, String l) | public Statement | createStatement(Resource r, Property p, String o, String l, boolean wellFormed) | public Statement | createStatement(Resource r, Property p, RDFNode o) create a Statement from the given r, p, and o. | public Literal | createTypedLiteral(boolean v) create a type literal from a boolean value.
The value is converted to a string using its toString
method. | public Literal | createTypedLiteral(int v) create a typed literal from an integer value. | public Literal | createTypedLiteral(long v) create a typed literal from a long integer value. | public Literal | createTypedLiteral(char v) create a typed literal from a char value. | public Literal | createTypedLiteral(float v) create a typed literal from a float value. | public Literal | createTypedLiteral(double v) create a typed literal from a double value. | public Literal | createTypedLiteral(String v) create a typed literal from a String value. | public Literal | createTypedLiteral(Calendar cal) Create a typed literal xsd:dateTime from a Calendar object. | public Literal | createTypedLiteral(String lex, RDFDatatype dtype) Build a typed literal from its lexical form. | public Literal | createTypedLiteral(Object value, RDFDatatype dtype) Build a typed literal from its value form. | public Literal | createTypedLiteral(String lex, String typeURI) Build a typed literal from its lexical form. | public Literal | createTypedLiteral(Object value, String typeURI) Build a typed literal from its value form. | public Literal | createTypedLiteral(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. | protected static Model | createWorkModel() | public Model | difference(Model model) | public void | enterCriticalSection(boolean requestReadLock) | public Object | executeInTransaction(Command cmd) | public String | expandPrefix(String prefixed) | public ExtendedIterator | findTriplesFrom(Selector s) Answer an [extended] iterator which returns the triples in this graph which
are selected by the (S, P, O) triple in the selector, ignoring any special
tests it may do. | public Alt | getAlt(String uri) | public Alt | getAlt(Resource r) | public Resource | getAnyReifiedStatement(Statement s) get any reification of the given statement in this model; make
one if necessary. | public Bag | getBag(String uri) | public Bag | getBag(Resource r) | protected BulkUpdateHandler | getBulkUpdateHandler() | public static PrefixMapping | getDefaultModelPrefixes() | public Graph | getGraph() | public Model | getHiddenStatements() a read-only Model with all the statements of this Model and any
statements "hidden" by reification. | public synchronized Lock | getLock() | public synchronized ModelLock | getModelLock() | public Map | getNsPrefixMap() | public String | getNsPrefixURI(String prefix) | public String | getNsURIPrefix(String uri) | public Property | getProperty(String uri) | public Property | getProperty(String nameSpace, String localName) | public Statement | getProperty(Resource s, Property p) | public RDFNode | getRDFNode(Node n) | public RDFReader | getReader() | public RDFReader | getReader(String lang) | public ReificationStyle | getReificationStyle() | public Statement | getRequiredProperty(Resource s, Property p) | public Resource | getResource(String uri, ResourceF f) | public Resource | getResource(String uri) | public Seq | getSeq(String uri) | public Seq | getSeq(Resource r) | public RDFWriter | getWriter() Get the model's writer after priming it with the model's namespace
prefixes. | public RDFWriter | getWriter(String lang) Get the model's writer after priming it with the model's namespace
prefixes. | public boolean | independent() | public static Model | intersect(Model smaller, Model larger) Answer a Model that is the intersection of the two argument models. | public Model | intersection(Model other) Intersect this with another model. | public boolean | isClosed() | public boolean | isEmpty() | public boolean | isIsomorphicWith(Model m) Answer whether or not these two graphs are isomorphic, taking the
hidden (reification) statements into account. | public boolean | isReified(Statement s) | public void | leaveCriticalSection() | public StmtIterator | listBySubject(Container cont) | public StmtIterator | listLiteralStatements(Resource S, Property P, boolean O) | public StmtIterator | listLiteralStatements(Resource S, Property P, long O) | public StmtIterator | listLiteralStatements(Resource S, Property P, char O) | public StmtIterator | listLiteralStatements(Resource S, Property P, double O) | public NsIterator | listNameSpaces() | public NodeIterator | listObjects() | public NodeIterator | listObjectsOfProperty(Property p) | public NodeIterator | listObjectsOfProperty(Resource s, Property p) | public RSIterator | listReifiedStatements() | public RSIterator | listReifiedStatements(Statement st) | public ResIterator | listResourcesWithProperty(Property p, boolean o) | public ResIterator | listResourcesWithProperty(Property p, char o) | public ResIterator | listResourcesWithProperty(Property p, long o) | public ResIterator | listResourcesWithProperty(Property p, float o) | public ResIterator | listResourcesWithProperty(Property p, double o) | public ResIterator | listResourcesWithProperty(Property p, Object o) | public ResIterator | listResourcesWithProperty(Property p) | public ResIterator | listResourcesWithProperty(Property p, RDFNode o) | protected StmtIterator | listStatements(Resource S, Property P, Node O) | public StmtIterator | listStatements(Resource S, Property P, RDFNode O) | public StmtIterator | listStatements(Resource S, Property P, String O) | public StmtIterator | listStatements(Resource S, Property P, String O, String L) | public StmtIterator | listStatements() | public StmtIterator | listStatements(Selector selector) | public ResIterator | listSubjects() | public ResIterator | listSubjectsWithProperty(Property p, RDFNode o) | public ResIterator | listSubjectsWithProperty(Property p, String o) | public ResIterator | listSubjectsWithProperty(Property p, String o, String l) | public ResIterator | listSubjectsWithProperty(Property p) | public StmtIterator | listlLiteralStatements(Resource S, Property P, float O) | public PrefixMapping | lock() | public Model | notifyEvent(Object e) | public String | qnameFor(String uri) | public Model | query(Selector selector) | public QueryHandler | queryHandler() | public Model | read(String url) | public Model | read(Reader reader, String base) | public Model | read(InputStream reader, String base) | public Model | read(String url, String lang) | public Model | read(String url, String base, String lang) | public Model | read(Reader reader, String base, String lang) | public Model | read(InputStream reader, String base, String lang) | public Model | register(ModelChangedListener listener) Register the listener with this model by registering its GraphListener
adaption with the underlying Graph. | public String | reifiedToString() | public Model | remove(Statement s) | public Model | remove(Resource s, Property p, RDFNode o) | public Model | remove(StmtIterator iter) | public Model | remove(Model m) | public Model | remove(Model m, boolean suppressReifications) | public Model | remove(Statement[] statements) remove all the Statements from the model by converting them to triples and
removing those triples from the underlying graph. | public Model | remove(List statements) Remove all the Statements from the model by converting the List to a
List(Statement) and removing that. | public Model | removeAll() | public Model | removeAll(Resource s, Property p, RDFNode o) | public void | removeAllReifications(Statement s) | public PrefixMapping | removeNsPrefix(String prefix) | public void | removeReification(ReifiedStatement rs) | public boolean | samePrefixMappingAs(PrefixMapping other) | public static PrefixMapping | setDefaultModelPrefixes(PrefixMapping pm) | public PrefixMapping | setNsPrefix(String prefix, String uri) | public PrefixMapping | setNsPrefixes(PrefixMapping pm) | public PrefixMapping | setNsPrefixes(Map map) | public String | setReaderClassName(String lang, String className) | public String | setWriterClassName(String lang, String className) | public String | shortForm(String uri) | public long | size() | protected String | statementsToString(StmtIterator it) | public boolean | supportsSetOperations() | public boolean | supportsTransactions() | public String | toString() | public Model | union(Model model) | public Model | unregister(ModelChangedListener listener) Unregister the listener from this model by unregistering its GraphListener
adaption from the underlying Graph. | public PrefixMapping | withDefaultMappings(PrefixMapping other) | public Model | write(Writer writer) | public Model | write(Writer writer, String lang) | public Model | write(Writer writer, String lang, String base) | public Model | write(OutputStream writer) | public Model | write(OutputStream writer, String lang) | public Model | write(OutputStream writer, String lang, String base) |
modelReifier | protected ModelReifier modelReifier(Code) | | the ModelReifier does everything to do with reification.
|
ModelCom | public ModelCom(Graph base)(Code) | | make a model based on the specified graph
|
adapt | public GraphListener adapt(ModelChangedListener L)(Code) | | Answer a GraphListener that, when fed graph-level update events,
fires the corresponding model-level event handlers in L .
See Also: ModelListenerAdapter Parameters: L - a model listener to be wrapped as a graph listener a graph listener wrapping L |
add | public Model add(Statement[] statements)(Code) | | Add all the statements to the model by converting them to an array of corresponding
triples and removing those from the underlying graph.
|
add | public Model add(List statements)(Code) | | Add all the statements to the model by converting the list to an array of
Statement and removing that.
|
addCommon | protected static Model addCommon(Model result, StmtIterator it, Model other)(Code) | | Answer the argument result with all the statements from the statement iterator that
are in the other model added to it.
Parameters: result - the Model to add statements to and return Parameters: it - an iterator over the candidate statements Parameters: other - the model that must contain the statements to be added result, after the suitable statements have been added to it |
addNamespaces | public static void addNamespaces(Model m, Map ns)(Code) | | Service method to update the namespaces of a Model given the
mappings from prefix names to sets of URIs.
If the prefix maps to multiple URIs, then we discard it completely.
Parameters: the - Model who's namespace is to be updated Parameters: ns - the namespace map to add to the Model |
asFilter | public Filter asFilter(Selector s)(Code) | | Answer a Filter that filters exactly those things the Selector selects.
Parameters: s - a Selector on statements a Filter that accepts statements that s passes tests on |
asStatement | public Statement asStatement(Triple t)(Code) | | Answer a Statement in this Model whcih encodes the given Triple.
Parameters: t - a triple to wrap as a statement a statement wrapping the triple and in this model |
close | public void close()(Code) | | |
containsAll | public boolean containsAll(Model model)(Code) | | |
containsAny | public boolean containsAny(Model model)(Code) | | |
createList | public RDFList createList()(Code) | | Answer a (the) new empty list
An RDF-encoded list of no elements (ie nil) |
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 RDF nodes from the given array, in order
Parameters: members - An array of RDFNodes that will be the members of the list An RDF-encoded list |
createReifiedStatement | public ReifiedStatement createReifiedStatement(Statement s)(Code) | | create a ReifiedStatement that encodes _s_ and belongs to this Model.
|
createTypedLiteral | public Literal createTypedLiteral(boolean v)(Code) | | create a type literal from a boolean value.
The value is converted to a string using its toString
method.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(int v)(Code) | | create a typed literal from an integer value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(long v)(Code) | | create a typed literal from a long integer value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(char v)(Code) | | create a typed literal from a char value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(float v)(Code) | | create a typed literal from a float value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(double v)(Code) | | create a typed literal from a double value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(String v)(Code) | | create a typed literal from a String value.
Parameters: v - the value of the literal a new literal representing the value v |
createTypedLiteral | public Literal createTypedLiteral(Calendar cal)(Code) | | Create a typed literal xsd:dateTime from a Calendar object.
|
createTypedLiteral | public Literal createTypedLiteral(String lex, RDFDatatype dtype) throws DatatypeFormatException(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.
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.
Parameters: value - the value of the literal Parameters: dtype - the type of the literal, null for old style "plain" literals |
createTypedLiteral | public Literal createTypedLiteral(String lex, String typeURI)(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.
Parameters: lex - the lexical form of the literal Parameters: typeURI - the uri of 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, String typeURI)(Code) | | Build a typed literal from its value form.
Parameters: value - the value of the literal Parameters: typeURI - the URI of 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 |
createWorkModel | protected static Model createWorkModel()(Code) | | |
enterCriticalSection | public void enterCriticalSection(boolean requestReadLock)(Code) | | |
findTriplesFrom | public ExtendedIterator findTriplesFrom(Selector s)(Code) | | Answer an [extended] iterator which returns the triples in this graph which
are selected by the (S, P, O) triple in the selector, ignoring any special
tests it may do.
Parameters: s - a Selector used to supply subject, predicate, and object an extended iterator over the matching (S, P, O) triples |
getAnyReifiedStatement | public Resource getAnyReifiedStatement(Statement s)(Code) | | get any reification of the given statement in this model; make
one if necessary.
Parameters: s - for which a reification is sought a ReifiedStatement that reifies _s_ |
getHiddenStatements | public Model getHiddenStatements()(Code) | | a read-only Model with all the statements of this Model and any
statements "hidden" by reification. That model is dynamic, ie
any changes this model will be reflected that one.
|
getNsPrefixMap | public Map getNsPrefixMap()(Code) | | |
getWriter | public RDFWriter getWriter()(Code) | | Get the model's writer after priming it with the model's namespace
prefixes.
|
getWriter | public RDFWriter getWriter(String lang)(Code) | | Get the model's writer after priming it with the model's namespace
prefixes.
|
independent | public boolean independent()(Code) | | |
intersect | public static Model intersect(Model smaller, Model larger)(Code) | | Answer a Model that is the intersection of the two argument models. The first
argument is the model iterated over, and the second argument is the one used
to check for membership. [So the first one should be "small" and the second one
"membership cheap".]
|
isClosed | public boolean isClosed()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
isIsomorphicWith | public boolean isIsomorphicWith(Model m)(Code) | | Answer whether or not these two graphs are isomorphic, taking the
hidden (reification) statements into account.
|
isReified | public boolean isReified(Statement s)(Code) | | true iff this model has a reification of _s_ in some Statement |
leaveCriticalSection | public void leaveCriticalSection()(Code) | | |
listReifiedStatements | public RSIterator listReifiedStatements()(Code) | | an iterator which delivers all the ReifiedStatements in this model |
listReifiedStatements | public RSIterator listReifiedStatements(Statement st)(Code) | | an iterator each of whose elements is a ReifiedStatement in thismodel such that it's getStatement().equals( st ) |
register | public Model register(ModelChangedListener listener)(Code) | | Register the listener with this model by registering its GraphListener
adaption with the underlying Graph.
Parameters: a - ModelChangedListener to register for model events this model, for cascading |
remove | public Model remove(Statement[] statements)(Code) | | remove all the Statements from the model by converting them to triples and
removing those triples from the underlying graph.
|
remove | public Model remove(List statements)(Code) | | Remove all the Statements from the model by converting the List to a
List(Statement) and removing that.
|
removeAllReifications | public void removeAllReifications(Statement s)(Code) | | remove any ReifiedStatements reifying the given statement
Parameters: s - the statement who's reifications are to be discarded |
supportsSetOperations | public boolean supportsSetOperations()(Code) | | |
supportsTransactions | public boolean supportsTransactions()(Code) | | |
unregister | public Model unregister(ModelChangedListener listener)(Code) | | Unregister the listener from this model by unregistering its GraphListener
adaption from the underlying Graph.
Parameters: a - ModelChangedListener to unregister from model events this model, for cascading |
|
|