Changeset 21


Ignore:
Timestamp:
Jul 12, 2011, 12:54:04 PM (14 years ago)
Author:
cla
Message:

rdfint

  • added unittest rdfa_set and methods stubs & documentation for rdfa::Data::setValue and rdfa::Projection::set
Location:
php/trunk
Files:
3 added
2 edited

Legend:

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

    r20 r21  
    756756  } // public function _getFirstValue
    757757
     758  // --------------------------------------------------------
     759
     760  /**
     761   * Sets a property value for a subject.
     762   *
     763   * \param subject   subject to get the property set
     764   * \param property  property to be added
     765   * \param value     value to be set for the property
     766   * \param type      the type of the value, either 'uri', 'literal' or 'bnode'
     767   *                  (case-insensitive). Specifying the first character is sufficient.
     768   *                  If not specified, strings starting with 'http://' are taken as a URI,
     769   *                  otherwise as a literal
     770   * \retval true property value set
     771   * \retval false subject not found or invalid value type specified
     772   *
     773   * \see rdfa::Projection::set
     774   *
     775   * <strong>NOTE:
     776   * - This method is a library specific extension to the RDFa API
     777   * - The parameter type is a library specific extension to the RDF API
     778   * </strong>
     779   */
     780
     781  public function setValue( $subject, $property, $value, $type = NULL) {
     782
     783    $predicate = $property;
     784    $object = $value;
     785
     786    // insert code here
     787  }
     788
    758789  /**@} */ /***************** DOXYGEN GROUP ENDS - Basic APIs */
    759790
     
    10031034        $ser = \ARC2::getTurtleSerializer();
    10041035        break;
    1005        
     1036
    10061037      case 'n3':
    10071038        $ser = \ARC2::getNTriplesSerializer();
    10081039        break;
    1009        
     1040
    10101041      case 'json':
    10111042        $ser = \ARC2::getRDFJSONSerializer();
    10121043        break;
    1013      
     1044
    10141045    } // switch ($type)
    10151046
     
    10171048
    10181049  } // public function _serialize
    1019  
     1050
    10201051} // class Data
    10211052
  • php/trunk/classes/rdfa_Projection.php

    r17 r21  
    150150    return $this->rdfaData->getValues( $this->subject, $property);
    151151  } // public function getAll
     152 
     153  // --------------------------------------------------------
     154
     155  /**
     156   * Sets a property value.
     157   *
     158   * \param property  property to be added
     159   * \param value     value to be set for the property
     160   * \param type      the type of the value, either 'uri', 'literal' or 'bnode'
     161   *                  (case-insensitive). Specifying the first character is sufficient.
     162   *                  If not specified, strings starting with 'http://' are taken as a URI,
     163   *                  otherwise as a literal
     164   * \retval object projection
     165   * \retval false invalid value type specified
     166   *
     167   * \see rdfa::Data::setValue
     168   *
     169   * <strong>NOTE:
     170   * - This method is a library specific extension to the RDFa API
     171   * - The parameter type is a library specific extension to the RDF API
     172   * </strong>
     173   */
     174
     175  public function set( $property, $value, $type = NULL) {
     176
     177    // insert code here
     178  }
    152179
    153180} // class Projection
Note: See TracChangeset for help on using the changeset viewer.