A TripleStore is an RDF Database. RDF defines a language for representing information about resources. A resource can be anything: an abstract concept, a pysical object, anything. Any resource may be given a resource identifier by which to refer to it. These resource identifiers as well as literal values are used when making statements about a resource. The statements have the form: subject predicate object and are often called triples.
A TripleStore is a place to add, remove and query for triples. Each triple in the TripleStore has the form:
There are two types of resource identifiers, namely, URIRef and BNode. A property is a type of resource and are used when talking about the particular aspect of a resource that the property represents. Properties must be represented by URIRefs and may not be given BNode identifiers; This is a somewhat arbitrary constraint, but none the less is clearly imposed by the specifications. A Literal is used for the object of a statement when it itself represents the object, and in which case the object has no resource identifier.
There are three core TripleStore methods:
TripleStore also implements the following convience methods on top of the triples method:
TripleStore also implement the following methods:
for triple in store: print triple
if (s, p, o) in store: print "found it"
len(store)
store_a==store_b
store += another_store
store -= another_store
See also some examples of using the TripleStores.