Ignore:
Timestamp:
Jul 13, 2011, 1:33:27 PM (14 years ago)
Author:
cla
Message:

rdfint

  • all classes: added missing comments on return value
  • Projection::construct and rdfa::SparqlQuery: added missing comment on exceptions
  • Data::parse
    • added note on merge feature
    • added code to return boolean
File:
1 edited

Legend:

Unmodified
Added
Removed
  • php/trunk/classes/rdfa_Data.php

    r28 r29  
    2323 *  \class  Data
    2424 *  \brief  This class implements a RDF data class as described in the
    25  *          RDF API and RDFa API specs of W3C.
     25 *          \c RDF \c API and \c RDFa \c API specs of W3C.
    2626 *  \author Christian Langanke
    2727 *  \author Adrian Gschwend
     
    342342   * Sets short-hand IRI mappings that are used by the API to map URIs to CURIEs.
    343343   *
    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
    346351   */
    347352  public function setMapping( $prefix, $uriNamespace) {
     
    350355      $this->debugger->sendMessage( $debugmessage,
    351356                                    self::debugcontext);
     357    return;
    352358  } // public function setMapping
    353359
     
    360366   *
    361367   * \param curie            CURIE to be resolved to a URI
     368   * \retval string          URI
     369   * \retval NULL            Mapping could not be found
    362370   *
    363371   * \note This method is a library specific extension to the RDF API and RDFa API
     
    399407   *
    400408   * \param uri            URI to be shrinked to a CURIE
     409   * \retval string        CURIE or URI
    401410   *
    402411   * \note This method is a library specific extension to the RDF API and RDFa API
     
    432441   * Parses RDF data from a URI.
    433442   *
    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
    435446   *
    436447   * \note
     
    438449   * - Parsing from a SPARQL CONSTRUCT query by using a SparqlQuery object, is a library specific
    439450   *   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
    440453   */
    441454  public function parse( $toparse) {
     
    471484
    472485    }
     486    // could something be parsed ?
     487    $result = (count( $newTriples) > 0);
    473488
    474489    // determine operation mode
     
    490505    $this->debugger->sendMessage( $debugMessage, self::debugcontext);
    491506
     507    return $result;
     508
    492509  } //   public function parse
    493510
     
    503520   * Retrieves a list of all values expressed in the RDF Data that match the given subject and property.
    504521   *
    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
    507526   *
    508527   * If no arguments are provided, all values from within the RDF data are returned.
     
    552571   * Retrieves a list of all properties expressed in the RDF data that match the given subject.
    553572   *
    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
    555576   *
    556577   * If a subject is not provided, all properties expressed in the RDF data are returned.
     
    599620
    600621  /**
    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
    605628   *
    606629   * If a subject isn't provided, all unique properties expressed in the RDF data are returned.
    607630   *
    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
    609634   */
    610635  public function _getUniqueProperties( $subject = Null) {
     
    658683   * Retrieves a list of all values expressed in the RDF data that match the given subject and property.
    659684   *
    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
    662689   *
    663690   * If no arguments are provided, all values expressed in the RDF data are returned.
     
    709736   * Retrieves the first available value expressed in the RDF data that matches the given subject and property.
    710737   *
    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
    713742   *
    714743   * If no arguments are provided, the first value expressed in the RDF data is returned.
     
    760789   * Sets a property value for a subject.
    761790   *
    762    * \param subject   subject to get the property set
    763    * \param property  property to be added
    764    * \param value     value to be set for the property
    765    * \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'
    766795   *                  (case-insensitive). Specifying the first character is sufficient.
    767796   *                  If not specified, strings starting with 'http://' are taken as a URI,
    768797   *                  otherwise as a literal
    769    * \retval true property value set
    770    * \retval false subject not found or invalid value type specified
     798   * \retval boolean  true: property value set \n
     799   *                  false: subject not found or invalid value type specified
    771800   *
    772801   * \see rdfa::Projection::set
     
    781810
    782811    // insert code here
     812   
     813    return $result;
    783814
    784815  } // public function _setValue
     
    797828   * A template can be provided for the purpose of building the Projection in an application-specific way.
    798829   *
    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
    801834   *
    802835   */
     
    833866   * A template can be provided for the purpose of building the Projection in an application-specific way.
    834867   *
    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
    838873   *
    839874   * If no arguments are provided, projections are created for all subjects from within the RDF data.
     
    879914   * A template can be provided for the purpose of building the Projection in an application-specific way.
    880915   *
    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
    883920   *
    884921   * If no arguments are provided, projections are created for all subjects from within the RDF data.
     
    9841021   * Returns a serialization of the triple data.
    9851022   *
    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
    9871026   *
    9881027   * Currently supported mime type identifiers are:
     
    10271066        $ser = \ARC2::getRDFXMLSerializer();
    10281067        break;
    1029      
     1068
    10301069      case 'turtle':
    10311070        $ser = \ARC2::getTurtleSerializer();
Note: See TracChangeset for help on using the changeset viewer.