Changeset 29 for php/trunk/classes/rdfa_Data.php
- Timestamp:
- Jul 13, 2011, 1:33:27 PM (14 years ago)
- File:
-
- 1 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();
Note:
See TracChangeset
for help on using the changeset viewer.