Triplestore Class
Triplestore wrapper for HTML5 WebStorage.
Constructor
Triplestore
()
Item Index
Methods
add
-
subject
-
property
-
value
Add a triple to localStorage. If the property has already values, the new value is concatenated to them.
Parameters:
-
subject
Stringsubject
-
property
Stringproperty
-
value
Stringvalue
Example:
st.add("http://sample.org/bob", "foaf:name", "Bob");
getProjection
-
subject
Retrieves a Projection given a subject
Parameters:
-
subject
Stringsubject
Returns:
Example:
st.getProjection("http://sample.org/bob");
getProperties
-
[subject]
Retrieves a list of DOMStrings which are IRI identifiers for properties given an optional subject to match against.
Parameters:
-
[subject]
String optionalsubject
Returns:
Example:
st.getProperties("http://sample.org/bob");
getSubjects
-
[property]
-
[value]
Retrieves a list of DOMStrings which are IRI identifiers for subjects given an optional property and value to match against.
Parameters:
-
[property]
String optionalproperty
-
[value]
String optionalvalue
Returns:
Example:
st.getSubjects("foaf:name", "Bob");
getValues
-
[subject]
-
[property]
Retrieves a list of mixed types given an optional subject and property to match against.
Parameters:
-
[subject]
String optionalsubject
-
[property]
String optionalproperty
Returns:
Example:
st.getValues("http://sample.org/bob", "foaf:name");
remove
-
[subject]
-
[property]
Remove an subject or a property from internal storage to match against.
Parameters:
-
[subject]
String optionalsubject
-
[property]
String optionalproperty
Example:
st.remove("http://sample.org/bob", "foaf:name");
set
-
subject
-
property
-
value
Set a triple to localStorage. The old value of the property is overwritten.
Parameters:
-
subject
Stringsubject
-
property
Stringproperty
-
value
Stringvalue
Example:
st.set("http://sample.org/bob", "foaf:name", "Bob");
setMapping
-
mapping
-
iri
Sets a mapping given a mapping and a URI to map.
Parameters:
-
mapping
Stringmapping
-
iri
Stringiri
Example:
st.setMapping("foaf", "http://xmlns.com/foaf/0.1/");
show
()
Print the content of the storage.