|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.enhanced.Polymorphic com.hp.hpl.jena.enhanced.EnhGraph com.hp.hpl.jena.rdf.model.impl.ModelCom de.fuberlin.wiwiss.ng4j.NamedGraphModel
public class NamedGraphModel
Jena Model
implementation providing a resource-centric view on
a NamedGraphSet
's union graph. It is backed by the NamedGraphSet.
Changes to one are reflected by the other.
All Statements returned by the NamedGraphModel can be casted to
NamedGraphStatement
s. They provide information about which
NamedGraphs they are contained in.
All Statements that are added to the model are added to a distinguished default NamedGraph. Removing Statements deletes them from all NamedGraphs in the backing set.
All flavours of the read and write methods support the TriX format which keeps the association of statements and their graph names.
All read operations on other RDF files will load the statements into a graph named with the file's URI, replacing older statements from the same source. This can be very handy for data management.
Methods that return new Models, like Model.query(com.hp.hpl.jena.rdf.model.Selector)
and
Model.union(com.hp.hpl.jena.rdf.model.Model)
, will not return new NamedGraphModels but
normal Jena ModelMems. (This is because Jena makes it hard to
return anything but ModelMems without much copy & paste.)
Note: This class was implemented without considering reification. It still contains reification methods inherited from Jena, but those do probably not work.
TODO: Properly test read and write methods
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException |
Field Summary |
---|
Fields inherited from class com.hp.hpl.jena.rdf.model.impl.ModelCom |
---|
mapAsStatement, modelReifier |
Fields inherited from class com.hp.hpl.jena.enhanced.EnhGraph |
---|
enhNodes, graph |
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
Extended, Standard |
Fields inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
---|
READ, WRITE |
Constructor Summary | |
---|---|
NamedGraphModel(NamedGraphSet graphSet,
String defaultGraphForAdding)
Initialises a NamedGraphModel. |
Methods inherited from class com.hp.hpl.jena.rdf.model.impl.ModelCom |
---|
abort, adapt, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addCommon, addNamespaces, asFilter, asModel, asNode, asRDFNode, asStatement, asStatements, asStatements, asStatements, begin, close, commit, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, containsAll, containsAll, containsAllThenClose, containsAny, containsAny, containsAnyThenClose, containsResource, createAlt, createAlt, createBag, createBag, createList, createList, createList, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createProperty, createReifiedStatement, createReifiedStatement, createResource, createResource, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createWorkModel, difference, enterCriticalSection, executeInTransaction, expandPrefix, findTriplesFrom, getAlt, getAlt, getAnyReifiedStatement, getBag, getBag, getBulkUpdateHandler, getDefaultModelPrefixes, getGraph, getHiddenStatements, getLock, getModelLock, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, getProperty, getProperty, getProperty, getRDFNode, getReader, getReader, getReificationStyle, getRequiredProperty, getSeq, getSeq, getWriter, getWriter, independent, intersect, intersection, isClosed, isEmpty, isIsomorphicWith, isReified, leaveCriticalSection, listBySubject, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listReifiedStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, lock, notifyEvent, qnameFor, query, queryHandler, read, register, reifiedToString, remove, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeAllReifications, removeNsPrefix, removeReification, samePrefixMappingAs, setDefaultModelPrefixes, setNsPrefix, setNsPrefixes, setNsPrefixes, setReaderClassName, setWriterClassName, shortForm, size, statementsToString, supportsSetOperations, supportsTransactions, toString, union, unregister, usePrefix, withDefaultMappings |
Methods inherited from class com.hp.hpl.jena.enhanced.EnhGraph |
---|
asGraph, canSupport, convertTo, equals, getNodeAs, getNodeCacheControl, getPersonality, hashCode, isIsomorphicWith, isValid, setNodeCache |
Methods inherited from class com.hp.hpl.jena.enhanced.Polymorphic |
---|
addView, already, alreadyHasView, asInternal, supports |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelGraphInterface |
---|
asRDFNode, asStatement, getGraph, queryHandler |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFReaderF |
---|
getReader, getReader, setReaderClassName |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFWriterF |
---|
getWriter, getWriter, setWriterClassName |
Methods inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, lock, qnameFor, removeNsPrefix, samePrefixMappingAs, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, usePrefix, withDefaultMappings |
Methods inherited from interface com.hp.hpl.jena.shared.Lock |
---|
enterCriticalSection, leaveCriticalSection |
Constructor Detail |
---|
public NamedGraphModel(NamedGraphSet graphSet, String defaultGraphForAdding)
graphSet
- A NamedGraphSet to back the modeldefaultGraphForAdding
- a default graph name to be used when
statements are added to the modelMethod Detail |
---|
public NamedGraphSet getNamedGraphSet()
public Resource getDefaultGraphName()
public Statement createStatement(Resource s, Property p, RDFNode o)
Subsequent operations on the statement or any of its parts may modify this model.
createStatement
in interface Model
createStatement
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
s
- the subject of the statementp
- the predicate of the statemento
- the object of the statement
public StmtIterator listStatements()
listStatements
in interface Model
listStatements
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public StmtIterator listStatements(Selector selector)
listStatements
in interface Model
listStatements
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
selector
- A selector object
public Model read(InputStream reader, String base, String lang)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model read(InputStream reader, String base)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model read(Reader reader, String base, String lang)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model read(Reader reader, String base)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model read(String url, String lang)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model read(String url)
read
in interface Model
read
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(OutputStream writer, String lang, String base)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(OutputStream writer, String lang)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(OutputStream writer)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(Writer writer, String lang, String base)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(Writer writer, String lang)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Model write(Writer writer)
write
in interface Model
write
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
public Resource getResource(String uri)
getResource
in interface Model
getResource
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
ModelCom.getResource(java.lang.String)
public Resource getResource(String uri, ResourceF f)
getResource
in interface ModelCon
getResource
in class com.hp.hpl.jena.rdf.model.impl.ModelCom
ModelCom.getResource(java.lang.String, com.hp.hpl.jena.rdf.model.ResourceF)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |