Class jQuery.rdf.triple
Represents an RDF triple.
Defined in: jquery.rdf.js.
Constructor Attributes | Constructor Name and Description |
---|---|
jQuery.rdf.triple(subject, property, value, options)
Creates a new jQuery.rdf.triple object.
|
Field Attributes | Field Name and Description |
---|---|
(Experimental) The named graph the triple belongs to.
|
|
The object of the triple.
|
|
The property of the triple.
|
|
The source of the triple, which might be a node within the page (if the RDF is generated from the page) or a string holding the pattern that generated the triple.
|
|
The subject of the triple.
|
Method Attributes | Method Name and Description |
---|---|
dump()
Returns a RDF/JSON representation of this triple.
|
|
isFixed()
Always returns true for triples.
|
|
toString()
Returns a string representing this triple in Turtle format.
|
|
triple(bindings)
Always returns this triple.
|
Class Detail
jQuery.rdf.triple(subject, property, value, options)
Creates a new jQuery.rdf.triple object. This should be invoked as a method rather than constructed using new; indeed you will not usually want to generate these objects directly, since they are automatically created from strings where necessary, such as by jQuery.rdf#add.
pattern = $.rdf.triple('<>', $.rdf.type, 'foaf:Person', { namespaces: { foaf: "http://xmlns.com/foaf/0.1/" }});
pattern = $.rdf.triple('<> a foaf:Person', { namespaces: { foaf: "http://xmlns.com/foaf/0.1/" } });
- Parameters:
- {String|jQuery.rdf.resource|jQuery.rdf.blank} subject
- The subject of the triple, or a single string that defines the entire triple. If the subject is specified as a string, it can be a fixed resource (
<uri>
orcurie
) or a blank node (_:id
). - {String|jQuery.rdf.resource} property Optional
- The property pattern. If the property is specified as a string, it must be a fixed resource (
<uri>
orcurie
). - {String|jQuery.rdf.resource|jQuery.rdf.blank|jQuery.rdf.literal} value Optional
- The value pattern. If the property is specified as a string, it can be a fixed resource (
<uri>
orcurie
), a blank node (_:id
), or a literal ("value"
). - {Object} options Optional
- Initialisation of the triple.
- {Object} options.namespaces Optional
- An object representing a set of namespace bindings used when interpreting the CURIEs in the subject, property and object.
- {String|jQuery.uri} options.base Optional
- The base URI used to interpret any relative URIs used within the subject, property and object.
- Throws:
- {String}
- Errors if any of the strings are not in a recognised format.
- Returns:
- {jQuery.rdf.triple} The newly-created triple.
Field Detail
{jQuery.rdf.resource|jQuery.rdf.blank}
graph
(Experimental) The named graph the triple belongs to.
The object of the triple.
{jQuery.rdf.resource}
property
The property of the triple.
source
The source of the triple, which might be a node within the page (if the RDF is generated from the page) or a string holding the pattern that generated the triple.
{jQuery.rdf.resource|jQuery.rdf.blank}
subject
The subject of the triple.
Method Detail
{Object}
dump()
Returns a RDF/JSON representation of this triple.
- Returns:
- {Object}
isFixed()
Always returns true for triples.
{String}
toString()
Returns a string representing this triple in Turtle format.
- Returns:
- {String}
triple(bindings)
Always returns this triple.
- Parameters:
- bindings