se.kmr.scam.rdf.util
Class SCAMUtil

java.lang.Object
  extended byse.kmr.scam.rdf.util.SCAMUtil

public class SCAMUtil
extends Object

Description of the Class

Version:
$Revision: 1.10 $
Author:
Jöran
Created:
den 9 december 2002

Field Summary
protected static org.apache.log4j.Category _cat
          Description of the Field
 
Constructor Summary
SCAMUtil()
           
 
Method Summary
static Resource addContentLocation(Resource resource, String location)
          Deprecated.  
static Resource addContentName(Resource resource, String name)
          Deprecated.  
static Resource addContentSize(Resource resource, long size)
          Deprecated.  
static Resource addMimeType(Resource resource, String mimeType)
          Deprecated.  
static String getContentLocation(Resource resource)
          Gets the content location for a Resource.
static String getContentName(Resource resource)
          Gets the content name for a Resource.
static String getContentSize(Resource resource)
          Gets the content size for a Resource.
static String getMimeType(Resource resource)
          Gets the MIME-type for a Resource.
static List listProperties(Model m, Resource subject, Property predicate, Resource type)
          List all objects of given type having subject of given predicate. :) Ontology-helper.
static List listPropertyLabels(Model m, Resource subject, Property predicate, String lang)
          List all labels (DC.title) of subject with given predicate
static Resource setContentLocation(Resource resource, String location)
          Sets content location property to a Resource.
static Resource setContentName(Resource resource, String name)
          Sets content name property to a Resource.
static Resource setContentSize(Resource resource, long size)
          Set content size property to a Resource.
static Resource setMimeType(Resource resource, String mimeType)
          Sets a MIME-type property to a Resource.
static Model setModelIdentity(List resourceList, String identity, Model model)
          Sets the modelIdentity property of a list of resources in a model.
static Model setModelIdentity(Resource resource, String identity, Model model)
          Sets the modelIdentity property of a resource in a model.
static Model setModelIdentity(String uri, String identity, Model model)
          Sets the modelIdentity property of a resource in a model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cat

protected static org.apache.log4j.Category _cat
Description of the Field

Constructor Detail

SCAMUtil

public SCAMUtil()
Method Detail

setModelIdentity

public static Model setModelIdentity(String uri,
                                     String identity,
                                     Model model)
Sets the modelIdentity property of a resource in a model. The Resource is given as an URI.

Parameters:
uri - the uri of the Resource
identity - The new modelIdentity value
model - Set the property in this model
Returns:
A model with the new property

setModelIdentity

public static Model setModelIdentity(Resource resource,
                                     String identity,
                                     Model model)
Sets the modelIdentity property of a resource in a model.

Parameters:
resource - The Resource
identity - The new modelIdentity value
model - Set the property in this model
Returns:
A model with the new property

setModelIdentity

public static Model setModelIdentity(List resourceList,
                                     String identity,
                                     Model model)
Sets the modelIdentity property of a list of resources in a model. The resource is represented in the list either with a uri (String ) or with a Resource.

Parameters:
identity - The new modelIdentity value
model - Set the properties in this model.
resourceList - the list of resources
Returns:
A model with the new properties

addMimeType

public static Resource addMimeType(Resource resource,
                                   String mimeType)
                            throws RDFException
Deprecated.  

Adds MIME-type properties to a Resource. The Resource must originate from a model.
http://kmr.nada.kth.se/el/ims/md-lomrdf.html

Throws:
RDFException

setMimeType

public static Resource setMimeType(Resource resource,
                                   String mimeType)
                            throws RDFException
Sets a MIME-type property to a Resource. The Resource must originate from a model.
http://kmr.nada.kth.se/el/ims/md-lomrdf.html

Throws:
RDFException

getMimeType

public static String getMimeType(Resource resource)
                          throws RDFException
Gets the MIME-type for a Resource. The Resource must originate from a model.
http://kmr.nada.kth.se/el/ims/md-lomrdf.html

Throws:
RDFException

addContentSize

public static Resource addContentSize(Resource resource,
                                      long size)
                               throws RDFException
Deprecated.  

Adds content size properties to a Resource. The Resource must originate from a model.

Throws:
RDFException

setContentSize

public static Resource setContentSize(Resource resource,
                                      long size)
                               throws RDFException
Set content size property to a Resource. The Resource must originate from a model.

Throws:
RDFException

getContentSize

public static String getContentSize(Resource resource)
                             throws RDFException
Gets the content size for a Resource. The Resource must originate from a model.

Throws:
RDFException

addContentName

public static Resource addContentName(Resource resource,
                                      String name)
                               throws RDFException
Deprecated.  

Adds content name properties to a Resource.
The name is short file name used by the originating filesystem.
The Resource must originate from a model.

Throws:
RDFException

setContentName

public static Resource setContentName(Resource resource,
                                      String name)
                               throws RDFException
Sets content name property to a Resource.
The name is short file name used by the originating filesystem.
The Resource must originate from a model.

Throws:
RDFException

getContentName

public static String getContentName(Resource resource)
                             throws RDFException
Gets the content name for a Resource. The Resource must originate from a model.

Throws:
RDFException

addContentLocation

public static Resource addContentLocation(Resource resource,
                                          String location)
                                   throws RDFException
Deprecated.  

Adds content location properties to a Resource.
The location identifies the content in the repository. The Resource must originate from a model.

Throws:
RDFException

setContentLocation

public static Resource setContentLocation(Resource resource,
                                          String location)
                                   throws RDFException
Sets content location property to a Resource.
The location identifies the content in the repository. The Resource must originate from a model.

Throws:
RDFException

getContentLocation

public static String getContentLocation(Resource resource)
                                 throws RDFException
Gets the content location for a Resource. The Resource must originate from a model.

Throws:
RDFException

listProperties

public static List listProperties(Model m,
                                  Resource subject,
                                  Property predicate,
                                  Resource type)
                           throws RDFException
List all objects of given type having subject of given predicate. :) Ontology-helper.

Parameters:
m - Model
subject - Subject
predicate - Predicate
type - RDF.type
Returns:
List of Resources
Throws:
RDFException

listPropertyLabels

public static List listPropertyLabels(Model m,
                                      Resource subject,
                                      Property predicate,
                                      String lang)
                               throws RDFException
List all labels (DC.title) of subject with given predicate

Parameters:
m - Model
subject - Subject
predicate - Predicate
lang - Language (null means any)
Returns:
List of Strings
Throws:
RDFException


Copyright © 2003 SCAM. All Rights Reserved.