ProcessorXML Class Reference
[Framework for the Web Services]
Manipulate structWSF internal XML resultset data resultsets. More...
Public Member Functions | |
| __construct () | |
| Constructor. | |
| __destruct () | |
| createResultset () | |
| Create a resultset root element. | |
| createSubject ($type, $uri="") | |
| Create a subject in the resultset. | |
| createPrefix ($entity, $uri) | |
| Create a prefix element for the resultset. | |
| createPredicate ($type) | |
| Create a predicate for the resultset. | |
| createObject ($type, $uri, $label="") | |
| Create an object for the resultset. | |
| createObjectContent ($content) | |
| Create an object that has a content (literal). | |
| createReificationStatement ($type, $value) | |
| Create a reification statement for the resultset. | |
| saveXML ($resultset) | |
| Save the resultset as a XML file. | |
| loadXML ($xml_doc) | |
| Load a XML document that is a resultset. | |
| createResultsetFromElement (&$element) | |
| Create a resultset from a node reference of the current resultset. | |
| appendElementToRoot (&$element) | |
| Append an element to the root element of the current XML document. | |
| importNode (&$targetElement, $importElement) | |
| getSubjectsByType ($type) | |
| Get a list of nodes of a given type. | |
| transformPrefix ($type) | |
| getSubjects () | |
| Get al subjects of a resultset. | |
| getPrefixes () | |
| Get all prefixes for this document. | |
| getSubjectContent (&$subject) | |
| getXPath ($xpath) | |
| Send a XPath query to the resultset. | |
| getPredicatesByType (&$subject, $type) | |
| Get a list of predicate nodes of a given type. | |
| getPredicates (&$subject) | |
| Get all predicates for a given subject of the resultset. | |
| getObjectsByType (&$predicate, $type) | |
| Get all objects for a given predicate of the resultset for a given type. | |
| getObjects (&$predicate) | |
| Get all objects for a given predicate of the resultset. | |
| getReificationStatementsByType (&$object, $type) | |
| Get the reification statement of a triple by its reification type. | |
| getReificationStatements (&$object) | |
| Get the reification statement of a triple. | |
| getURI (&$node) | |
| Get URI of a node of the resulset. | |
| getEntity (&$node) | |
| Get the Entity of a prefix element. | |
| getLabel (&$node) | |
| Get Label of a node of the resulset. | |
| getValue (&$node) | |
| Get value of a node of the resulset. | |
| getType (&$node, $prefixed=TRUE) | |
| Get type of a node of the resulset. | |
| getContent (&$node) | |
| Get content of a node of the resulset. | |
| removeChildren (&$node) | |
| removePredicatesByType (&$subject, $type) | |
| Remove all the predicates assertions for a given subject. | |
| xmlEncode ($string) | |
| Encode content to be included in XML files. | |
| saveRdfN3 () | |
Private Member Functions | |
| escapeN3 ($literal) | |
Private Attributes | |
| $dom | |
| $prefixes = array() | |
Detailed Description
Manipulate structWSF internal XML resultset data resultsets.
- Returns:
- returns NULL
Definition at line 27 of file ProcessorXML.php.
Constructor & Destructor Documentation
| __construct | ( | ) |
Constructor.
Create a new DOM document for the XML document being processed
- Returns:
- returns NULL
Definition at line 44 of file ProcessorXML.php.
| __destruct | ( | ) |
Definition at line 49 of file ProcessorXML.php.
Member Function Documentation
| appendElementToRoot | ( | &$ | element | ) |
Append an element to the root element of the current XML document.
- Parameters:
-
[in] $element Reference to the element to happen to the root element of this XML document.
- Returns:
- returns NULL
Definition at line 385 of file ProcessorXML.php.
| createObject | ( | $ | type, | |
| $ | uri, | |||
| $ | label = "" | |||
| ) |
Create an object for the resultset.
- Parameters:
-
[in] $type Type of the object [in] $uri URI of the object [in] $label Optional label to refer to the object
- Returns:
- returns the reference to the predicate's element
Definition at line 176 of file ProcessorXML.php.
References $type, $uri, and xmlEncode().

| createObjectContent | ( | $ | content | ) |
Create an object that has a content (literal).
This kind of object are "literal objects"
- Parameters:
-
[in] $content Content of the literal.
- Returns:
- returns the reference to the object's element
Definition at line 223 of file ProcessorXML.php.
References xmlEncode().

| createPredicate | ( | $ | type | ) |
Create a predicate for the resultset.
- Parameters:
-
[in] $type Type of the predicate
- Returns:
- returns the reference to the predicate's element
Definition at line 148 of file ProcessorXML.php.
References $type, and xmlEncode().

| createPrefix | ( | $ | entity, | |
| $ | uri | |||
| ) |
Create a prefix element for the resultset.
- Parameters:
-
[in] $entity Entity prefix [in] $uri Uri that goes with the entity prefix
- Returns:
- returns the reference to the prefix element
Definition at line 115 of file ProcessorXML.php.
References $uri.
| createReificationStatement | ( | $ | type, | |
| $ | value | |||
| ) |
Create a reification statement for the resultset.
This is the way to reify a statement in the resultset
- Parameters:
-
[in] $type Type of the reification statement [in] $value Value of the reification statement
- Returns:
- returns the reference to the refification statement's element
- returns NULL
Definition at line 254 of file ProcessorXML.php.
References $type, and xmlEncode().

| createResultset | ( | ) |
Create a resultset root element.
- Returns:
- returns the created resulotset element
Definition at line 61 of file ProcessorXML.php.
| createResultsetFromElement | ( | &$ | element | ) |
Create a resultset from a node reference of the current resultset.
- Parameters:
-
[in] $element Reference to the node from which to create the resultset
- Returns:
- returns the new resultset being created
Definition at line 356 of file ProcessorXML.php.
References $dom.
| createSubject | ( | $ | type, | |
| $ | uri = "" | |||
| ) |
Create a subject in the resultset.
- Parameters:
-
[in] $type Type of the subject [in] $uri Optional URI for the subject
- Returns:
- returns the reference to the subject's element
Definition at line 81 of file ProcessorXML.php.
References $type, $uri, and xmlEncode().

| escapeN3 | ( | $ | literal | ) | [private] |
Definition at line 999 of file ProcessorXML.php.
Referenced by saveRdfN3().
| getContent | ( | &$ | node | ) |
Get content of a node of the resulset.
- Parameters:
-
[in] $node the reference node
- Returns:
- returns the content
Definition at line 854 of file ProcessorXML.php.
Referenced by saveRdfN3().
| getEntity | ( | &$ | node | ) |
Get the Entity of a prefix element.
- Parameters:
-
[in] $node the reference node
- Returns:
- returns the Entity
Definition at line 738 of file ProcessorXML.php.
| getLabel | ( | &$ | node | ) |
Get Label of a node of the resulset.
- Parameters:
-
[in] $node the reference node
- Returns:
- returns the Label
Definition at line 764 of file ProcessorXML.php.
| getObjects | ( | &$ | predicate | ) |
Get all objects for a given predicate of the resultset.
- Parameters:
-
[in] $predicate Target predicate
- Returns:
- returns a DOMNodeList with a reference to all objects of the resultset, for that predicate
Definition at line 622 of file ProcessorXML.php.
References $query.
Referenced by saveRdfN3().
| getObjectsByType | ( | &$ | predicate, | |
| $ | type | |||
| ) |
Get all objects for a given predicate of the resultset for a given type.
- Parameters:
-
[in] $predicate Target predicate [in] $type Target type
- Returns:
- returns a DOMNodeList with a reference to all objects of the resultset, for that predicate, for that type
Definition at line 589 of file ProcessorXML.php.
References $query, $type, and transformPrefix().

| getPredicates | ( | &$ | subject | ) |
Get all predicates for a given subject of the resultset.
- Parameters:
-
[in] $subject Target subject
- Returns:
- returns a DOMNodeList with a reference to all predicates of the resultset, for that subject
Definition at line 559 of file ProcessorXML.php.
References $query.
Referenced by saveRdfN3().
| getPredicatesByType | ( | &$ | subject, | |
| $ | type | |||
| ) |
Get a list of predicate nodes of a given type.
- Parameters:
-
[in] $subject Target subject to get its predicates from [in] $type Type of the nodes you want
- Returns:
- returns a DOMNodeList with a reference to all properties nodes of that type
Definition at line 528 of file ProcessorXML.php.
References $query, $type, and transformPrefix().

| getPrefixes | ( | ) |
Get all prefixes for this document.
- Returns:
- returns a DOMNodeList with a reference to all prefixes
Definition at line 477 of file ProcessorXML.php.
| getReificationStatements | ( | &$ | object | ) |
Get the reification statement of a triple.
- Parameters:
-
[in] $object the reference object node
- Returns:
- returns reification node
Definition at line 683 of file ProcessorXML.php.
References $query.
Referenced by saveRdfN3().
| getReificationStatementsByType | ( | &$ | object, | |
| $ | type | |||
| ) |
Get the reification statement of a triple by its reification type.
- Parameters:
-
[in] $object the reference object node [in] $type URI of the type of the reification statement
- Returns:
- returns reification node
Definition at line 652 of file ProcessorXML.php.
References $query, $type, and transformPrefix().

| getSubjectContent | ( | &$ | subject | ) |
Definition at line 488 of file ProcessorXML.php.
| getSubjects | ( | ) |
Get al subjects of a resultset.
- Returns:
- returns a DOMNodeList with a reference to all subjects of the resultset
Definition at line 456 of file ProcessorXML.php.
References $query.
Referenced by saveRdfN3().
| getSubjectsByType | ( | $ | type | ) |
Get a list of nodes of a given type.
- Parameters:
-
[in] $type Type of the nodes you want
- Returns:
- returns a DOMNodeList with a reference to all nodes of that type
Definition at line 416 of file ProcessorXML.php.
References $query, $type, and transformPrefix().

| getType | ( | &$ | node, | |
| $ | prefixed = TRUE | |||
| ) |
Get type of a node of the resulset.
- Parameters:
-
[in] $node the reference node [in] $prefixed Convert to prefixed form if a prefix exists for this type.
- Returns:
- returns the type
Definition at line 817 of file ProcessorXML.php.
References $uri.
Referenced by saveRdfN3().
| getURI | ( | &$ | node | ) |
Get URI of a node of the resulset.
- Parameters:
-
[in] $node the reference node
- Returns:
- returns the URI
Definition at line 712 of file ProcessorXML.php.
Referenced by saveRdfN3().
| getValue | ( | &$ | node | ) |
Get value of a node of the resulset.
- Parameters:
-
[in] $node the reference node
- Returns:
- returns the value
Definition at line 790 of file ProcessorXML.php.
Referenced by saveRdfN3().
| getXPath | ( | $ | xpath | ) |
Send a XPath query to the resultset.
- Parameters:
-
[in] $xpath The xpath query to send
- Returns:
- returns a DOMNodeList with a reference to all ndoes that are in that path
Definition at line 503 of file ProcessorXML.php.
References transformPrefix().

| importNode | ( | &$ | targetElement, | |
| $ | importElement | |||
| ) |
Definition at line 391 of file ProcessorXML.php.
| loadXML | ( | $ | xml_doc | ) |
Load a XML document that is a resultset.
- Parameters:
-
[in] $xml_doc XML document being loaded
- Returns:
- returns a reference to the DOM structure of the loaded XML document
Definition at line 308 of file ProcessorXML.php.
References $uri.
| removeChildren | ( | &$ | node | ) |
Helper function that removes all child nodes of $node recursively (i.e. including child nodes of the child nodes and so forth).
Definition at line 872 of file ProcessorXML.php.
| removePredicatesByType | ( | &$ | subject, | |
| $ | type | |||
| ) |
Remove all the predicates assertions for a given subject.
- Parameters:
-
[in] $subject Target subject for which to remove the predicate assertions [in] $type URI of the predicate to remove.
- Returns:
- returns Nothing
Definition at line 898 of file ProcessorXML.php.
References $query, $type, and transformPrefix().

| saveRdfN3 | ( | ) |
Definition at line 936 of file ProcessorXML.php.
References escapeN3(), getContent(), getObjects(), getPredicates(), getReificationStatements(), getSubjects(), getType(), getURI(), and getValue().

| saveXML | ( | $ | resultset | ) |
Save the resultset as a XML file.
- Parameters:
-
[in] $resultset Resultset to be save as a xml document.
- Returns:
- returns the XML document of the resultset
Definition at line 287 of file ProcessorXML.php.
| transformPrefix | ( | $ | type | ) |
Definition at line 429 of file ProcessorXML.php.
Referenced by getObjectsByType(), getPredicatesByType(), getReificationStatementsByType(), getSubjectsByType(), getXPath(), and removePredicatesByType().
| xmlEncode | ( | $ | string | ) |
Encode content to be included in XML files.
- Parameters:
-
[in] $string The content string to be encoded
- Returns:
- returns the encoded string
Definition at line 926 of file ProcessorXML.php.
Referenced by createObject(), createObjectContent(), createPredicate(), createReificationStatement(), and createSubject().
Field Documentation
$dom [private] |
Definition at line 29 of file ProcessorXML.php.
Referenced by createResultsetFromElement().
$prefixes = array() [private] |
Definition at line 31 of file ProcessorXML.php.
Referenced by getPrefixes().
The documentation for this class was generated from the following file:
