Class Index | File Index

Classes


Class jQuery.rdf.ruleset

A jQuery.rdf.ruleset object represents a set of jQuery.rdf.rules that can be run over a databank.
Defined in: jquery.rules.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
jQuery.rdf.ruleset(rules, options)
Creates a new jQuery.rdf.ruleset object.
Method Summary
Method Attributes Method Name and Description
 
add(lhs, rhs)
Adds a rule or set of rules to this ruleset.
 
base(base)
Sets or returns the base URI of the jQuery.rdf.ruleset.
 
prefix(prefix, namespace)
Sets or returns a namespace binding on the jQuery.rdf.ruleset.
 
run(data, options)
Runs the rules held in this ruleset on the data passed as the first argument.
 
size()
Returns the number of rules in this ruleset.
Class Detail
jQuery.rdf.ruleset(rules, options)

Creates a new jQuery.rdf.ruleset object. This should be invoked as a method rather than constructed using new.

rules = jQuery.rdf.ruleset();
Parameters:
{jQuery.rdf.rule[]} rules Optional, Default: []
An array of rules with which the ruleset is initialised.
{Object} options Optional
Initialisation options for the ruleset.
{Object} options.namespaces Optional
An object representing a set of namespace bindings which are stored and used whenever a CURIE is used within a rule.
{String|jQuery.uri} options.base Optional
The base URI used to interpret any relative URIs used within the rules.
Returns:
{jQuery.rdf.ruleset}
See:
jQuery.rdf.rule
Method Detail
{jQuery.rdf.ruleset} add(lhs, rhs)
Adds a rule or set of rules to this ruleset.
rules = $.rdf.ruleset()
  .prefix('foaf', ns.foaf)
  .add('?person a foaf:Person', '?person a foaf:Agent');
Parameters:
{String|Array|Function|jQuery.rdf.pattern|jQuery.rdf.rule|jQuery.rdf.ruleset} lhs
A jQuery.rdf.rule will be added directly. If a jQuery.rdf.ruleset is provided then all its rules will be added to this one. Otherwise, specifies the left hand side of the rule to be added, as in jQuery.rdf.rule.
{String|Function|jQuery.rdf.pattern} rhs
The right hand side of the rule to be added.
Returns:
{jQuery.rdf.ruleset} Returns this jQuery.rdf.ruleset
See:
jQuery.rdf.rule

base(base)
Sets or returns the base URI of the jQuery.rdf.ruleset.
rules = $.rdf.ruleset()
  .base('http://www.example.org/');
Parameters:
{String|jQuery.uri} base Optional
Returns:
A jQuery.uri if no base URI is specified, otherwise returns this jQuery.rdf.ruleset object.

{Object|jQuery.uri|jQuery.rdf} prefix(prefix, namespace)
Sets or returns a namespace binding on the jQuery.rdf.ruleset.
Parameters:
{String} prefix Optional
{String} namespace Optional
Returns:
{Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the jQuery.rdf.ruleset. If a prefix is specified without a namespace, returns the jQuery.uri associated with that prefix. Otherwise returns this jQuery.rdf object after setting the namespace binding.

{jQuery.rdf.ruleset} run(data, options)
Runs the rules held in this ruleset on the data passed as the first argument.
rules = $.rdf.ruleset()
  .prefix('foaf', ns.foaf)
  .add('?person a foaf:Person', '?person a foaf:Agent')
  .run(data);
Parameters:
{jQuery.rdf.databank} data
A databank containing data to be reasoned over and added to.
{Object} options Optional
{Integer} options.limit Optional, Default: 50
The rules in this ruleset are generally run over the jQuery.rdf.databank until it stops growing. In some situations, notably when creating blank nodes, this can lead to an infinite loop. The limit option indicates the maximum number of times the ruleset will be run before halting.
Returns:
{jQuery.rdf.ruleset} Returns this ruleset.
See:
jQuery.rdf#reason
jQuery.rdf.databank#reason

{Integer} size()
Returns the number of rules in this ruleset.
Returns:
{Integer}

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jul 14 2009 19:56:45 GMT+0100 (BST)