Class that represents an RDF resource
Located in /EasyRdf/Resource.php (line 46)
Constructor
* Please do not call new EasyRdf_Resource() directly *
To create a new resource use the get method in a graph: $resource = $graph->resource('http://www.example.com/');
Add values to for a property of the resource
The value can either be a single value or an array of values.
Example: $resource->add('prefix:property', 'value');
Add a literal value as a property of the resource
The value can either be a single value or an array of values.
Example: $resource->add('dc:title', 'Title of Page');
Add a resource as a property of the resource
Example: $bob->add('foaf:knows', 'http://example.com/alice');
Add one or more rdf:type properties to the resource
Get all values for a property
This method will return an empty array if the property does not exist.
Get all literal values for a property of the resource
This method will return an empty array if the resource does not has any literal values for that property.
Get all resources for a property of the resource
This method will return an empty array if the resource does not has any resources for that property.
Delete a property (or optionally just a specific value)
Return a human readable view of the resource and its properties
This method is intended to be a debugging aid and will print a resource and its properties.
Return pretty-print view of the resource
Get a single value for a property
If multiple values are set for a property then the value returned may be arbitrary.
If $property is an array, then the first item in the array that matches a property that exists is returned.
This method will return null if the property does not exist.
Get a single literal value for a property of the resource
If multiple values are set for a property then the value returned may be arbitrary.
This method will return null if there is not literal value for the property.
Get the identifier for a blank node
Returns null if the resource is not a blank node.
Get a single resource value for a property of the resource
If multiple values are set for a property then the value returned may be arbitrary.
This method will return null if there is not resource for the property.
Returns the URI for the resource.
Check to see if a property exists for this resource.
This method will return true if the property exists.
Check to see if a resource is a blank node.
Check if a resource is of the specified type
Concatenate all values for a property into a string.
The default is to join the values together with a space character. This method will return an empty string if the property does not exist.
Get a human readable label for this resource
This method will check a number of properties for the resource (in the order: skos:prefLabel, rdfs:label, foaf:name, dc:title) and return an approriate first that is available. If no label is available then it will return null.
Get a the prefix of the namespace that this resource is part of
This method will return null the resource isn't part of any registered namespace.
Get the primary topic of this resource.
Returns null if no primary topic is available.
Get a list of all the shortened property names (qnames) for a resource.
This method will return an empty array if the resource has no properties.
Get a list of the full URIs for the properties of this resource.
This method will return an empty array if the resource has no properties.
Get a list of the full URIs for the properties that point to this resource.
Set value(s) for a property
The new value(s) will replace the existing values for the property. The name of the property should be a string. If you set a property to null or an empty array, then the property will be deleted.
Change the rdf:type property for the resource
Note that the PHP class of the resource will not change.
Get a shortened version of the resources URI.
This method will return the full URI if the resource isn't part of any registered namespace.
Returns the properties of the resource as an associative array
For example: array('type' => 'uri', 'value' => 'http://www.example.com/')
Get a single type for a resource.
The type will be a shortened URI as a string. If the resource has multiple types then the type returned may be arbitrary. This method will return null if the resource has no type.
Get a single type for a resource, as a resource.
The type will be returned as an EasyRdf_Resource. If the resource has multiple types then the type returned may be arbitrary. This method will return null if the resource has no type.
Get a list of types for a resource.
The types will each be a shortened URI as a string. This method will return an empty array if the resource has no types.
Magic method to return URI of resource when casted to string
Documentation generated on Wed, 20 Jul 2011 19:54:05 +0100 by phpDocumentor 1.4.3