Changeset 29
- Timestamp:
- Jul 13, 2011, 1:33:27 PM (14 years ago)
- Location:
- php/trunk/classes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
php/trunk/classes/rdfa_Data.php
r28 r29 23 23 * \class Data 24 24 * \brief This class implements a RDF data class as described in the 25 * RDF API and RDFaAPI specs of W3C.25 * \c RDF \c API and \c RDFa \c API specs of W3C. 26 26 * \author Christian Langanke 27 27 * \author Adrian Gschwend … … 342 342 * Sets short-hand IRI mappings that are used by the API to map URIs to CURIEs. 343 343 * 344 * \param prefix namespace prefix of the mapping 345 * \param uriNamespace namespace base URI of the mapping 344 * \param prefix Namespace prefix of the mapping 345 * \param uriNamespace Namespace base URI of the mapping 346 * \retval void 347 * 348 * \note The return value 349 * - is not described in the \c RDFa \c API specification 350 * - should be a string in the \c RDF \c API, but the value is not described 346 351 */ 347 352 public function setMapping( $prefix, $uriNamespace) { … … 350 355 $this->debugger->sendMessage( $debugmessage, 351 356 self::debugcontext); 357 return; 352 358 } // public function setMapping 353 359 … … 360 366 * 361 367 * \param curie CURIE to be resolved to a URI 368 * \retval string URI 369 * \retval NULL Mapping could not be found 362 370 * 363 371 * \note This method is a library specific extension to the RDF API and RDFa API … … 399 407 * 400 408 * \param uri URI to be shrinked to a CURIE 409 * \retval string CURIE or URI 401 410 * 402 411 * \note This method is a library specific extension to the RDF API and RDFa API … … 432 441 * Parses RDF data from a URI. 433 442 * 434 * \param toparse resource to parse from. This can be a URI or an object of SparqlQuery 443 * \param toparse Resource to parse from. This can be a URI or an object of SparqlQuery 444 * \retval boolean true: the parsed graph contains data 445 * \retval boolean false: the parsed graph contains no data 435 446 * 436 447 * \note … … 438 449 * - Parsing from a SPARQL CONSTRUCT query by using a SparqlQuery object, is a library specific 439 450 * extension to both the RDF API and RDFa API. 451 * - On all consecutive calls to parse, the newly parsed graph is merged into the existing graph. 452 * Such a feature is not described in the W3C specs 440 453 */ 441 454 public function parse( $toparse) { … … 471 484 472 485 } 486 // could something be parsed ? 487 $result = (count( $newTriples) > 0); 473 488 474 489 // determine operation mode … … 490 505 $this->debugger->sendMessage( $debugMessage, self::debugcontext); 491 506 507 return $result; 508 492 509 } // public function parse 493 510 … … 503 520 * Retrieves a list of all values expressed in the RDF Data that match the given subject and property. 504 521 * 505 * \param property property that the subject should be linked with 506 * \param value value that the specified property should have 522 * \param property Property that the subject should be linked with 523 * \param value Value that the specified property should have 524 * \retval array List of subjects 525 * \retval boolean false: the graph contains no data 507 526 * 508 527 * If no arguments are provided, all values from within the RDF data are returned. … … 552 571 * Retrieves a list of all properties expressed in the RDF data that match the given subject. 553 572 * 554 * \param subject subject to be searched 573 * \param subject Subject to be searched 574 * \retval array List of properties 575 * \retval boolean false: the subject was not found 555 576 * 556 577 * If a subject is not provided, all properties expressed in the RDF data are returned. … … 599 620 600 621 /** 601 * Retrieves an associative list of unique properties with their values expressed in the RDF data 602 * that match the given subject. All non-unique properties are <i>NOT</i> returned ! 603 * 604 * \param subject subject to be searched 622 * Gets an associative list of unique properties with their values 623 * expressed in the RDF data that match the given subject. 624 * 625 * \param subject Subject to be searched 626 * \retval array Associative list of unqique properties and their values 627 * \retval boolean false: the subject could not be found 605 628 * 606 629 * If a subject isn't provided, all unique properties expressed in the RDF data are returned. 607 630 * 608 * \note This method is a library specific extension to the RDF API and RDFa API 631 * \note 632 * - All non-unique properties are \c NOT returned ! 633 * - This method is a library specific extension to the RDF API and RDFa API 609 634 */ 610 635 public function _getUniqueProperties( $subject = Null) { … … 658 683 * Retrieves a list of all values expressed in the RDF data that match the given subject and property. 659 684 * 660 * \param subject subject to be searched 661 * \param property property to be searched 685 * \param subject Subject to be searched 686 * \param property Property to be searched 687 * \retval array List of values 688 * \retval boolean false: a matching subject was not found 662 689 * 663 690 * If no arguments are provided, all values expressed in the RDF data are returned. … … 709 736 * Retrieves the first available value expressed in the RDF data that matches the given subject and property. 710 737 * 711 * \param subject subject to be searched 712 * \param property property to be searched 738 * \param subject Subject to be searched 739 * \param property Property to be searched 740 * \retval string First value of the property 741 * \retval boolean false: the subject could not be found 713 742 * 714 743 * If no arguments are provided, the first value expressed in the RDF data is returned. … … 760 789 * Sets a property value for a subject. 761 790 * 762 * \param subject subject to get the property set763 * \param property property to be added764 * \param value value to be set for the property765 * \param type the type of the value, either 'uri', 'literal' or 'bnode'791 * \param subject Subject to get the property set 792 * \param property Property to be added 793 * \param value Value to be set for the property 794 * \param type The type of the value, either 'uri', 'literal' or 'bnode' 766 795 * (case-insensitive). Specifying the first character is sufficient. 767 796 * If not specified, strings starting with 'http://' are taken as a URI, 768 797 * otherwise as a literal 769 * \retval true property value set770 * \retval falsesubject not found or invalid value type specified798 * \retval boolean true: property value set \n 799 * false: subject not found or invalid value type specified 771 800 * 772 801 * \see rdfa::Projection::set … … 781 810 782 811 // insert code here 812 813 return $result; 783 814 784 815 } // public function _setValue … … 797 828 * A template can be provided for the purpose of building the Projection in an application-specific way. 798 829 * 799 * \param subject subject to be searched 800 * \param template associative array( URI/CURIE => membername) as a template to be applied to the projection object 830 * \param subject Subject to be searched 831 * \param template Associative array( URI/CURIE => membername) as a template to be applied to the projection object 832 * \retval rdfa::Projection The projection on the subject 833 * \retval boolean false: the subject was not found 801 834 * 802 835 */ … … 833 866 * A template can be provided for the purpose of building the Projection in an application-specific way. 834 867 * 835 * \param property property that the subject of the projections should be linked with 836 * \param value value that the specified property should have 837 * \param template associative array( URI/CURIE => membername) as a template to be applied to the projection object 868 * \param property Property that the subject of the projections should be linked with 869 * \param value Value that the specified property should have 870 * \param template Associative array( URI/CURIE => membername) as a template to be applied to the projection object 871 * \retval array List of rdfa::Projection as projections on the matching subjects 872 * \retval boolean false: a matching subject was not found 838 873 * 839 874 * If no arguments are provided, projections are created for all subjects from within the RDF data. … … 879 914 * A template can be provided for the purpose of building the Projection in an application-specific way. 880 915 * 881 * \param query an associative array( URI/CURIE => value) specifying a multiple property filter 882 * \param template associative array( URI/CURIE => membername) as a template to be applied to the projection object 916 * \param query An associative array( URI/CURIE => value) specifying a multiple property filter 917 * \param template An associative array( URI/CURIE => membername) as a template to be applied to the projection object 918 * \retval array List of rdfa::Projection as projections on the matching subjects 919 * \retval boolean false: a matching subject was not found 883 920 * 884 921 * If no arguments are provided, projections are created for all subjects from within the RDF data. … … 984 1021 * Returns a serialization of the triple data. 985 1022 * 986 * \param type Supported RDF serialization MIME Media Types according to http://www.iana.org/assignments/media-types/index.html 1023 * \param type Supported RDF serialization MIME Media Types according to http://www.iana.org/assignments/media-types/index.html 1024 * \retval string Serialization of the graph data 1025 * \retval boolean false: the serialization type is invalid 987 1026 * 988 1027 * Currently supported mime type identifiers are: … … 1027 1066 $ser = \ARC2::getRDFXMLSerializer(); 1028 1067 break; 1029 1068 1030 1069 case 'turtle': 1031 1070 $ser = \ARC2::getTurtleSerializer(); -
php/trunk/classes/rdfa_Projection.php
r28 r29 49 49 * Creates a Projection instance from a Data instance, reflecting a given subject in the triple data. 50 50 * 51 * \param rdfaData instance of Reader holding the RDF data 52 * \param subject subject of the projection 53 * \param template template array specifying the members to be created from data linked to the subject 51 * \param rdfaData instance of rdfa::Data holding the graph of the subject 52 * \param subject Subject of the projection 53 * \param template Associative array( URI/CURIE => membername) as a template to be applied to the projection object 54 * 55 * \exception Exception The parameter rdfaData is not of object rdfa::Data 54 56 * 55 57 * \note A projection is to be created by the following methods only: … … 97 99 /** 98 100 * Gets properties of the subject of the projection. 99 * Returns a list of properties. 101 * 102 * \retval array List of properties 100 103 */ 101 104 public function getProperties() { … … 106 109 107 110 /** 108 * Gets unique properties of the subject of the projection. 111 * Gets an associative list of unique properties of the projection 112 * with their values. 109 113 * 110 * Ths method returns an associative list of properties => values. 111 * All non-unique properties are NOT returned ! 114 * \retval array Associative list of unqique properties and their values 112 115 * 113 * \note This method is a library specific extension to the RDF API and RDFa API 114 * 116 * \note 117 * - All non-unique properties are \c NOT returned ! 118 * - This method is a library specific extension to the RDF API and RDFa API 115 119 */ 116 120 public function _getUniqueProperties() { … … 122 126 /** 123 127 * Gets the subject of of the subject of the projection. 128 * 129 * \retval string Subject of the property 124 130 */ 125 131 public function getSubject() { … … 132 138 * Gets the first available value of a given property. 133 139 * 134 * \param property property to retrieve the first value of 140 * \param property Property to retrieve the first value of# 141 * \retval string First value of the property 135 142 */ 136 143 … … 144 151 * Gets a list of all available values of a given property. 145 152 * 146 * \param property property to retrieve all values of153 * \param property Property to retrieve all values of 147 154 */ 148 155 … … 150 157 return $this->rdfaData->getValues( $this->subject, $property); 151 158 } // public function getAll 152 159 153 160 // -------------------------------------------------------- 154 161 … … 156 163 * Sets a property value. 157 164 * 158 * \param property property to be added159 * \param value value to be set for the property160 * \param type the type of the value, either 'uri', 'literal' or 'bnode'165 * \param property Property to be added 166 * \param value Value to be set for the property 167 * \param type The type of the value, either 'uri', 'literal' or 'bnode' 161 168 * (case-insensitive). Specifying the first character is sufficient. 162 169 * If not specified, strings starting with 'http://' are taken as a URI, 163 170 * otherwise as a literal 164 * \retval object projection165 * \retval falseinvalid value type specified171 * \retval rdfa::Projection Success 172 * \retval boolean false: invalid value type specified 166 173 * 167 174 * \see rdfa::Data::setValue -
php/trunk/classes/rdfa_SparqlEndpoint.php
r17 r29 49 49 * Creates an endpoint configuration class instance. 50 50 * 51 * \param aconfig associative list of configuration data51 * \param aconfig Associative list of configuration data 52 52 */ 53 53 public function __construct( $aconfig) { … … 58 58 // initialize instance vars 59 59 $this->aconfig = array(); 60 60 61 61 // store inital configuration 62 62 if (is_array( $aconfig)) { … … 79 79 * Sets a single configuration value 80 80 * 81 * \param name name of the configurarion value 82 * \param value new value to be set 81 * \param name Name of the configurarion value 82 * \param value New value to be set 83 * \retval void 83 84 */ 84 85 public function setConfigurationValue( $name, $value) { … … 93 94 * Gets a single configuration value 94 95 * 95 * \param name name of the configurarion value 96 * \param name Name of the configurarion value 97 * \retval string Value of the specified configuration value 98 * \retval boolean false: the configuration value was not found 96 99 */ 97 100 public function getConfigurationValue( $name) { … … 106 109 /** 107 110 * Queries an associative list of the configuration values 111 * 112 * \retval array Associative list of the configuration data 108 113 */ 109 114 public function getConfigurationValues( ) { -
php/trunk/classes/rdfa_SparqlQuery.php
r28 r29 53 53 * \param statement SPARQL CONSTRUCT query statement to execute. 54 54 * 55 * \exception Exception The parameter endpoint is not of object rdfa::SparqlEndpoint 56 * 55 57 * \note To effectively execute the query, invoke the method 56 58 * - rdfa::SparqlQuery::run() … … 85 87 /** 86 88 * Gets the SPARQL query statementof the object. 89 * 90 * \retval string SPARQL statement 87 91 */ 88 92 … … 96 100 * Runs the SPARQL query of the object. 97 101 * 98 * Returns indexed RDF data.102 * \retval array indexed RDF data in internal format 99 103 */ 100 104
Note:
See TracChangeset
for help on using the changeset viewer.