de.hedenus.rdfschema
Interface Resource

All Known Subinterfaces:
Alt, Bag, Class, Container, List, Literal, Seq
All Known Implementing Classes:
AltImpl, BagImpl, Channel, ContainerImpl, Item, ListImpl, LiteralImpl, Ontology, ResourceImpl, SeqImpl

public interface Resource

This interface represents rdfs:Resource.
Note: Do not confuse with de.hedenus.rdf.Resource.

Author:
Michael Hedenus

Field Summary
static java.lang.String URI
           
 
Method Summary
 java.lang.String about()
          Returns the identifier of the resource, either its blank node ID or its URI.
 Resource[] getProperties(java.lang.String propertyURI)
          Returns the values of the properties with the specified property-URI as an array of resources.
 Resource getProperty(java.lang.String propertyURI)
          Returns the first property with the specified property-URI.
 java.lang.String getProperty(java.lang.String propertyURI, java.util.Locale locale)
          Returns the literal property with the specified property-URI and locale.
 java.lang.Object getProperty(java.lang.String propertyURI, java.lang.String datatypeURI)
          Returns the first property value of the property with the specified property-URI.
 

Field Detail

URI

static final java.lang.String URI
See Also:
Constant Field Values
Method Detail

about

java.lang.String about()
Returns the identifier of the resource, either its blank node ID or its URI.

Returns:
the resource identifier

getProperty

java.lang.Object getProperty(java.lang.String propertyURI,
                             java.lang.String datatypeURI)
Returns the first property value of the property with the specified property-URI. If datatypeURI is null and the value is a plain literal, a string is returned. If the property value is a plain literal and datatypeURI is not null, the specified datatypeURI will be applied to convert the plain literal into a Java type. If the property value is typed literal, the specified datatype must match the datatype of the literal or an exception is thrown. If the value is not a literal but a URI reference or a blank node, a Resource object is returned.

Parameters:
propertyURI - the property's URI
datatypeURI - the datatype's URI or null
Returns:
the property value or null if there is no statement that relates this resource with another by the specified property

getProperty

java.lang.String getProperty(java.lang.String propertyURI,
                             java.util.Locale locale)
Returns the literal property with the specified property-URI and locale. If the locale is null, the first matching literal property is returned. If locale is not null and there is no literal with a matching xml:lang attribute, null is returned.

Parameters:
propertyURI - the property's URI
locale - the locale or null
Returns:
a matching literal property or null

getProperty

Resource getProperty(java.lang.String propertyURI)
Returns the first property with the specified property-URI.

Parameters:
propertyURI - the property's URI
Returns:
the value as Resource

getProperties

Resource[] getProperties(java.lang.String propertyURI)
Returns the values of the properties with the specified property-URI as an array of resources. If there are no property values the array has length 0 (i.e. the result is never null).

Parameters:
propertyURI - the property's URI
Returns:
the values as array of Resource objects