Class jQuery
Defined in: jquery.uri.js.
Constructor Attributes | Constructor Name and Description |
---|---|
jQuery()
rdfQuery is a jQuery plugin.
|
Method Attributes | Method Name and Description |
---|---|
base()
Returns the base URI in scope for the first selected element
|
|
<static> |
jQuery.createCurie(uri, options)
Creates a CURIE string from a URI string.
|
createCurie(uri, options)
Creates a CURIE string from a URI string using the namespace
bindings in the context of the current jQuery selection.
|
|
curie(curie, options)
Creates a jQuery.uri object by parsing the specified
CURIE string in the context of the namespaces defined by the
jQuery selection.
|
|
<static> |
jQuery.curie(curie, uri, options)
Creates a jQuery.uri object by parsing a CURIE.
|
rdf()
Gleans RDF triples from the nodes held by the jQuery object, puts them into a jQuery.rdf.databank and returns a jQuery.rdf object that allows you to query and otherwise manipulate them.
|
|
rdfa(triple)
Creates a jQuery.rdf object containing the RDF triples parsed from the RDFa found in the current jQuery selection or adds the specified triple as RDFa markup on each member of the current jQuery selection.
|
|
removeRdfa(triple)
Removes the specified RDFa markup from each of the items in the current jQuery selection.
|
|
removeXmlns(prefix)
Removes one or more XML namespace bindings from the selected elements.
|
|
<static> |
jQuery.safeCurie(safeCurie, options)
Creates a jQuery.uri object by parsing a safe CURIE string (a CURIE
contained within square brackets).
|
safeCurie(safeCurie, options)
Creates a jQuery.uri object by parsing the specified
safe CURIE string in the context of the namespaces defined by
the jQuery selection.
|
|
xmlns(prefix, uri, inherited)
Returns the namespaces declared in the scope of the first selected element, or
adds a namespace declaration to all selected elements.
|
Class Detail
jQuery()
rdfQuery is a jQuery plugin. The only fields and methods listed here are those that come as part of the rdfQuery library.
Method Detail
{jQuery.uri}
base()
Returns the base URI in scope for the first selected element
baseURI = $('img').base();
- Returns:
- {jQuery.uri}
<static>
{jQuery.uri}
jQuery.createCurie(uri, options)
Creates a CURIE string from a URI string.
Defined in: jquery.curie.js.
Defined in: jquery.curie.js.
- Parameters:
- {String} uri
- The URI string to be converted to a CURIE.
- {Object} options Optional
- CURIE parsing options
- {string} options.reservedNamespace Optional, Default: 'http://www.w3.org/1999/xhtml/vocab#'
- If the input URI starts with this value, the generated CURIE will have no namespace prefix and will start with a colon character (:), unless the local part of the CURIE is one of the reserved names specified by the reservedNames option (see below), in which case the generated CURIE will have no namespace prefix and will not start with a colon character.
- {string} options.defaultNamespace Optional
- If the input URI starts with this value, the generated CURIE will have no namespace prefix and will not start with a colon.
- {Object} options.namespaces Optional
- A map of namespace bindings used to map CURIE prefixes to URIs.
- {string[]} options.reserved Optional, Default: ['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']
- A list of local names that will always be mapped to the URI specified by reservedNamespace.
- {string} options.charcase Optional, Default: 'lower'
- Specifies the case normalisation done to the CURIE. Acceptable values are:
- lower
- Normalise the CURIE to lower case.
- upper
- Normalise the CURIE to upper case.
- preserve
- Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.
- Returns:
- {jQuery.uri} A new jQuery.uri object representing the full absolute URI specified by the CURIE.
{String}
createCurie(uri, options)
Creates a CURIE string from a URI string using the namespace
bindings in the context of the current jQuery selection.
Defined in: jquery.curie.js.
Defined in: jquery.curie.js.
- Parameters:
- {String|jQuery.uri} uri
- The URI string to be converted to a CURIE
- {Object} options
- the CURIE parsing options. See jQuery.createCurie for details of the supported options. The namespace declarations declared on the current jQuery selection (and inherited from any ancestor elements) will automatically be included in the options.namespaces property.
- Returns:
- {String}
- See:
- jQuery.createCurie
{jQuery.uri}
curie(curie, options)
Creates a jQuery.uri object by parsing the specified
CURIE string in the context of the namespaces defined by the
jQuery selection.
Defined in: jquery.curie.js.
Defined in: jquery.curie.js.
- Parameters:
- {String} curie
- The CURIE string to be parsed
- {Object} options
- The CURIE parsing options. See jQuery.curie for details of the supported options. The namespace declarations declared on the current jQuery selection (and inherited from any ancestor elements) will automatically be included in the options.namespaces property.
- Returns:
- {jQuery.uri}
- See:
- jQuery.curie
<static>
{jQuery.uri}
jQuery.curie(curie, uri, options)
- Parameters:
- {String} curie
- The CURIE to be parsed
- {String} uri
- The URI string to be converted to a CURIE.
- {Object} options Optional
- CURIE parsing options
- {string} options.reservedNamespace Optional, Default: 'http://www.w3.org/1999/xhtml/vocab#'
- The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
- {string} options.defaultNamespace Optional
- The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
- {Object} options.namespaces Optional
- A map of namespace bindings used to map CURIE prefixes to URIs.
- {string[]} options.reserved Optional, Default: ['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']
- A list of local names that will always be mapped to the URI specified by reservedNamespace.
- {string} options.charcase Optional, Default: 'lower'
- Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
- lower
- Force the CURIE string to lower case.
- upper
- Force the CURIE string to upper case.
- preserve
- Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.
- Returns:
- {jQuery.uri} A new jQuery.uri object representing the full absolute URI specified by the CURIE.
{jQuery.rdf}
rdf()
Gleans RDF triples from the nodes held by the jQuery object, puts them into a jQuery.rdf.databank and returns a jQuery.rdf object that allows you to query and otherwise manipulate them. The mechanism for gleaning RDF triples from the web page depends on the rdfQuery modules that have been included. The core version of rdfQuery doesn't support any gleaners; other versions support a RDFa gleaner, and there are some modules available for common microformats.
Defined in: jquery.rdf.js.
Defined in: jquery.rdf.js.
$('#content').rdf().databank.dump();
- Returns:
- {jQuery.rdf} An empty query over the triples stored within the page.
{jQuery.rdf}
rdfa(triple)
Creates a jQuery.rdf object containing the RDF triples parsed from the RDFa found in the current jQuery selection or adds the specified triple as RDFa markup on each member of the current jQuery selection. To create an jQuery.rdf object, you will usually want to use jQuery#rdf instead, as this may perform other useful processing (such as of microformats used within the page).
Defined in: jquery.rdfa.js.
Defined in: jquery.rdfa.js.
// Extract RDFa markup from all span elements contained inside #main rdf = $('#main > span').rdfa();
// Add RDFa markup to a particular element var span = $('#main > p > span'); span.rdfa('<> dc:date "2008-10-19"^^xsd:date .');
- Parameters:
- {jQuery.rdf.triple} triple Optional
- The RDF triple to be added to each item in the jQuery selection.
- Returns:
- {jQuery.rdf}
{jQuery}
removeRdfa(triple)
Removes the specified RDFa markup from each of the items in the current jQuery selection. The input parameter can be either an object or an array of objects. The objects can either have a
Defined in: jquery.rdfa.js.
type
property, in which case the specified type is removed from the RDFa provided on the selected elements, or a property
property, in which case the specified property is removed from the RDFa provided on the selected elements.
Defined in: jquery.rdfa.js.
// To remove a property resource or relation from an element $('#main > p > a').removeRdfa({ property: "dc:creator" });
// To remove a type from an element $('#main >p > a').removeRdfa({ type: "foaf:Person" });
// To remove multiple triples from an element $('#main > p > a').removeRdfa([{ property: "foaf:depicts" }, { property: "dc:creator" }]);
- Parameters:
- {Object|Object[]} triple
- The RDFa markup items to be removed from the items in the jQuery selection.
- Returns:
- {jQuery} The original jQuery object.
{jQuery}
removeXmlns(prefix)
Removes one or more XML namespace bindings from the selected elements.
Defined in: jquery.xmlns.js.
Defined in: jquery.xmlns.js.
// Remove the foaf namespace declaration from the body element: $('body').removeXmlns('foaf');
// Remove the foo and bar namespace declarations from all h2 elements $('h2').removeXmlns(['foo', 'bar']);
// Remove the foo and bar namespace declarations from all h2 elements var namespaces = { foo : 'http://www.example.org/foo', bar : 'http://www.example.org/bar' }; $('h2').removeXmlns(namespaces);
- Parameters:
- {String|Object|String[]} prefix
- The prefix(es) of the XML namespace bindings that are to be removed from the selected elements.
- Returns:
- {jQuery} The original jQuery object.
<static>
{jQuery.uri}
jQuery.safeCurie(safeCurie, options)
Creates a jQuery.uri object by parsing a safe CURIE string (a CURIE
contained within square brackets). If the input safeCurie string does not
start with '[' and end with ']', the entire string content will be interpreted
as a URI string.
Defined in: jquery.curie.js.
Defined in: jquery.curie.js.
- Parameters:
- {String} safeCurie
- The safe CURIE string to be parsed.
- {Object} options Optional
- CURIE parsing options
- {string} options.reservedNamespace Optional, Default: 'http://www.w3.org/1999/xhtml/vocab#'
- The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
- {string} options.defaultNamespace Optional
- The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
- {Object} options.namespaces Optional
- A map of namespace bindings used to map CURIE prefixes to URIs.
- {string[]} options.reserved Optional, Default: ['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']
- A list of local names that will always be mapped to the URI specified by reservedNamespace.
- {string} options.charcase Optional, Default: 'lower'
- Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
- lower
- Force the CURIE string to lower case.
- upper
- Force the CURIE string to upper case.
- preserve
- Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.
- Returns:
- {jQuery.uri} A new jQuery.uri object representing the full absolute URI specified by the CURIE.
{jQuery.uri}
safeCurie(safeCurie, options)
Creates a jQuery.uri object by parsing the specified
safe CURIE string in the context of the namespaces defined by
the jQuery selection.
Defined in: jquery.curie.js.
Defined in: jquery.curie.js.
- Parameters:
- {String} safeCurie
- The safe CURIE string to be parsed. See jQuery.safeCurie for details on how safe CURIE strings are processed.
- {Object} options
- The CURIE parsing options. See jQuery.safeCurie for details of the supported options. The namespace declarations declared on the current jQuery selection (and inherited from any ancestor elements) will automatically be included in the options.namespaces property.
- Returns:
- {jQuery.uri}
- See:
- jQuery.safeCurie
{Object|jQuery.uri|jQuery}
xmlns(prefix, uri, inherited)
Returns the namespaces declared in the scope of the first selected element, or
adds a namespace declaration to all selected elements. Pass in no parameters
to return all namespaces bindings on the first selected element. If only
the prefix parameter is specified, this method will return the namespace
URI that is bound to the specified prefix on the first element in the selection
If the prefix and uri parameters are both specified, this method will
add the binding of the specified prefix and namespace URI to all elements
in the selection.
Defined in: jquery.xmlns.js.
Defined in: jquery.xmlns.js.
// Retrieve all of the namespace bindings on the HTML document element var nsMap = $('html').xmlns();
// Retrieve the namespace URI mapped to the 'dc' prefix on the HTML document element var dcNamespace = $('html').xmlns('dc');
// Create a namespace declaration that binds the 'dc' prefix to the URI 'http://purl.org/dc/elements/1.1/' $('html').xmlns('dc', 'http://purl.org/dc/elements/1.1/');
- Parameters:
- {String} prefix Optional
- Restricts the namespaces returned to only the namespace with the specified namespace prefix.
- {String|jQuery.uri} uri Optional
- Adds a namespace declaration to the selected elements that maps the specified prefix to the specified namespace.
- {Object} inherited Optional
- A map of inherited namespace bindings.
- Returns:
- {Object|jQuery.uri|jQuery}