Class SimpleRdf

(line 51)

Description


Located in File: /simplerdf.php

For terms of use see LICENSE.txt in this distribution.


Class Variables

Summary:

Class Constants

Summary:

Method Detail

Summary:
void __construct ()
void __destruct ()
void createElementAppend (mixed $parentNode, mixed $ns, mixed $prefix, mixed $name)
mixed find (mixed $subject, mixed $predicate, mixed $object, int $attrs, int $limit, [array $haystack = false])
mixed findFirst (mixed $subject, mixed $predicate, mixed $object, int $attrs)
bool loadDom (mixed $xmlDom, string $filters, DOMDocument $dom)
bool loadFile (string $file, string $filters)
bool loadXml (string $xml, string $filters)
mixed regExpFind (mixed $subject, mixed $predicate, mixed $object, int $attrs, int $limit, [array $haystack = false], int $_recursion)
mixed regExpFindFirst (mixed $subject, mixed $predicate, mixed $object, int $attrs, [array $haystack = false])
void saveNt (int 0)
saveXml ()
mixed wildcardFind (mixed $subject, mixed $predicate, mixed $object, int $attrs, int $limit, [array $haystack = false])
mixed wildcardFindFirst (mixed $subject, mixed $predicate, mixed $object, int $attrs)

Constructor __construct (line 146)

void __construct( )

Constructor.

Info

  • access - public

Destructor __destruct (line 890)

void __destruct( )

Info

Method createElementAppend (line 1081)

void createElementAppend( mixed $parentNode, mixed $ns, mixed $prefix, mixed $name)

Info

Method find (line 599)

mixed find( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0], [int $limit = 0], [array $haystack = false])

Find statements.

Parameters

  • mixed $subject: SimpleRdfResource object or URI string representing the resource RDF Subject or FALSE for any. Accepts array of strings or SimpleRdfResources as well.
  • mixed $predicate: SimpleRdfResource object or URI string representing the resource RDF Predicate or FALSE for any. Accepts array of strings or SimpleRdfResources as well.
  • mixed $object: SimpleRdfResource object or SimpleRdfLiteral object or resource URI string representing the RDF Object or FALSE for any. Accepts array of strings or SimpleRdfResources as well.
  • int $attrs: Miscellaneous attributes that control the search mechanism. Following constants can be used RDF_RETURN_VALUE - returns array of string URIs or strings form RDF Object Literals or N-Triple if no RDF_RETURN_OBJECT or RDF_RETURN_SUBJECT or RDF_RETURN_PREDICATE specified RDF_RETURN_OBJECT | RDF_RETURN_SUBJECT | RDF_RETURN_PREDICATE - return only given part instead of whole RDF Statement (default). RDF_RESOLVE_CONTAINER - do not return the RDF:Bag, RDF:Seq, RDF:Alt but directly their contained resources
  • int $limit: Terminate find after the limit of find Statements was reached. 0 for no-limit.
  • array $haystack: limit search to the given array of triples. Leave false to use all known triples.

Info

  • return - depends on the attributes: can be array of strings|array of SimpleRdfTriple objects|array of SimpleRdfNode objects|string|SimpleRdfNode. Note: The haystack's keys are preserved.
  • static -
  • access - public

Method findFirst (line 541)

mixed findFirst( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0])

Find the first matching statements.

Parameters

  • mixed $subject: SimpleRdfResource object or URI string representing the resource RDF Subject or FALSE for any
  • mixed $predicate: SimpleRdfResource object or URI string representing the resource RDF Predicate or FALSE for any
  • mixed $object: SimpleRdfResource object or SimpleRdfLiteral object or resource URI string representing the RDF Object or FALSE for any
  • int $attrs: Miscellaneous attributes that control the search mechanism.

Info

  • return - or NULL if not found.
  • static -
  • access - public

Method loadDom (line 273)

bool loadDom( mixed $xmlDom, string $filters, DOMDocument $dom)

Load/Read the RDF/XML DOM representation.

Parameters

  • DOMDocument $dom: RDF/XML string.
  • string $filters: list of whitespace separated names of input filters (XSL) to be applied before parsing.

Info

  • return - True on success otherwise False.
  • access - public

Method loadFile (line 239)

bool loadFile( string $file, string $filters)

Load/Read the RDF file.

Parameters

  • string $file: Name of the file.
  • string $filters: list of whitespace separated names of input filters (XSL) to be applied before parsing.

Info

  • return - True on success otherwise False.
  • access - public

Method loadXml (line 255)

bool loadXml( string $xml, string $filters)

Load/Read the RDF/XML string.

Parameters

  • string $xml: RDF/XML string.
  • string $filters: list of whitespace separated names of input filters (XSL) to be applied before parsing.

Info

  • return - True on success otherwise False.
  • access - public

Method regExpFind (line 660)

mixed regExpFind( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0], [int $limit = 0], [array $haystack = false], [int $_recursion = 0])

Perl-compatible regular expression find.

Same method as SimpleRdf::find() except the fact that all string parameters are considered to be Perl RegExp patterns.

For the parameter and output description see SimpleRdf::find()

Example: $rdf->regExpFind('"//slashdot.org/$"', FALSE, '/channel/');

Parameters

  • mixed $subject:
  • mixed $predicate:
  • mixed $object:
  • int $attrs:
  • int $limit:
  • array $haystack: limit search to the given array of triples. Leave false to use all known triples.
  • int $_recursion: Do not use! It's internal recursion loop counter!

Info

  • todo - Can the SimpleRdfLiteral be also RegExp? (using ATTR RDF_REGEXP_OBJECT?) Note: The haystack's keys are preserved.
  • static -
  • access - public
  • see - SimpleRdf::find() @

Method regExpFindFirst (line 560)

mixed regExpFindFirst( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0], [array $haystack = false])

Find the first matching statements using RegExp patterns.

Parameters

  • mixed $subject:
  • mixed $predicate:
  • mixed $object:
  • int $attrs:
  • array $haystack: limit search to the given array of triples. Leave false to use all known triples.

Info

  • return - or NULL if not found.
  • see - SimpleRdf::regExpFind() @
  • see - SimpleRdf::findFirst() @
  • static -
  • access - public

Method saveNt (line 880)

void saveNt( int 0)

Returns/Save the RDF in N-Triples RDF graph.

Parameters

  • int 0:

Info

  • access - public

Method saveXml (line 955)

saveXml( )

Save the RDF/XML.

Info

  • access - public

Method wildcardFind (line 630)

mixed wildcardFind( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0], [int $limit = 0], [array $haystack = false])

Find using the wilecard enabled patterns. Wildcards are often used for file matching in OS.

You can use the same syntax... Example of wildcard pattern: *gr[ae]y??

All string parameters are expected to be wildcard patterns.

For the parameter and output description see SimpleRdf::find()

Example: $rdf->wildcardFind('*://slashdot.org/', FALSE, '*chan?el');

Parameters

  • mixed $subject:
  • mixed $predicate:
  • mixed $object:
  • int $attrs:
  • int $limit:
  • array $haystack: limit search to the given array of triples. Leave false to use all known triples.

Info

  • return - Note: The haystack's keys are preserved.
  • static -
  • access - public
  • see - SimpleRdf::find() @

Method wildcardFindFirst (line 578)

mixed wildcardFindFirst( mixed $subject, mixed $predicate, mixed $object, [int $attrs = 0])

Find the first matching statements using wildcard patterns.

Parameters

  • mixed $subject:
  • mixed $predicate:
  • mixed $object:
  • int $attrs:

Info

  • return - or NULL if not found.
  • see - SimpleRdf::wildcardFind() @
  • see - SimpleRdf::findFirst() @
  • static -
  • access - public

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Fri, 19 Nov 2004 09:11:15 +0100 by phpDocumentor 1.3.0RC3