se.kmr.scam.rdf.test
Class Transform

java.lang.Object
  extended byse.kmr.scam.rdf.test.Transform

public class Transform
extends Object

Title:

Description:

Copyright: Copyright (c) 2003

Company:

Version:
1.0
Author:
jand

Constructor Summary
Transform()
           
 
Method Summary
static void addIfMissing(Model model, Property prop1, Property prop2, RDFNode def)
          Add the value of property prop2 to new prop1 if prop1 not exists.
static void changeDateFormat(Model model, Property dateProp, DateFormat from, DateFormat to)
          Change the Date-value of all statements having dateProp.
static void changeProperty(Model model, Property from, Property to)
          Replace all matching statements having Property
static void changePropertyAndValue(Model model, Property pFrom, Property pTo, Map map)
           
static void changePropertyAndValue(Model model, Property pFrom, Property pTo, RDFNode oFrom, RDFNode oTo)
          Replace all mathing predicate-objects.
static void changeValue(Model model, Property prop, RDFNode from, RDFNode to)
          Replace all mathing objects having Object.
static void changeValueToLowercase(Model model, Property prop)
           
static void removeProperty(Model model, RDFNode rdftype, Property prop)
          Remove a property for a specific type of Component.
static void renameWithProperty(Model model, Property prop, RDFNode object, Property name)
          Rename all subjects having given Predicate-Object with the value of predicate name.
static void setVCardFN(Model model, Property prop)
          Set object of prop to be inside a vCard:FN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transform

public Transform()
Method Detail

changeProperty

public static void changeProperty(Model model,
                                  Property from,
                                  Property to)
                           throws RDFException
Replace all matching statements having Property

Parameters:
from - Original Property
to - New Property
Throws:
RDFException

changeValue

public static void changeValue(Model model,
                               Property prop,
                               RDFNode from,
                               RDFNode to)
                        throws RDFException
Replace all mathing objects having Object.

Parameters:
model - Model
prop - Property (can be null)
from - Original Object
to - New Object
Throws:
RDFException

changeValueToLowercase

public static void changeValueToLowercase(Model model,
                                          Property prop)
                                   throws RDFException
Throws:
RDFException

changePropertyAndValue

public static void changePropertyAndValue(Model model,
                                          Property pFrom,
                                          Property pTo,
                                          RDFNode oFrom,
                                          RDFNode oTo)
                                   throws RDFException
Replace all mathing predicate-objects.

Parameters:
model - Model
pFrom - Original Property
pTo - New Property
oFrom - Original Object
oTo - New Object
Throws:
RDFException

changePropertyAndValue

public static void changePropertyAndValue(Model model,
                                          Property pFrom,
                                          Property pTo,
                                          Map map)
                                   throws RDFException
Throws:
RDFException

changeDateFormat

public static void changeDateFormat(Model model,
                                    Property dateProp,
                                    DateFormat from,
                                    DateFormat to)
                             throws RDFException
Change the Date-value of all statements having dateProp.

Parameters:
dateProp - Date-property
from - Original format
to - New format
Throws:
RDFException
ParseException

setVCardFN

public static void setVCardFN(Model model,
                              Property prop)
                       throws RDFException
Set object of prop to be inside a vCard:FN

Parameters:
model - Model
prop - Property, ex dc:creator
Throws:
RDFException

renameWithProperty

public static void renameWithProperty(Model model,
                                      Property prop,
                                      RDFNode object,
                                      Property name)
                               throws RDFException
Rename all subjects having given Predicate-Object with the value of predicate name. NOTE: Do not perform in a multi-model environment!

Parameters:
prop - Predicate
object - Object
name - Predicate containing new URI
Throws:
RDFException

addIfMissing

public static void addIfMissing(Model model,
                                Property prop1,
                                Property prop2,
                                RDFNode def)
                         throws RDFException
Add the value of property prop2 to new prop1 if prop1 not exists. Use def if prop2 value missing.

Parameters:
model - Model
prop1 - Wanted Property
prop2 - Value-containing Property
def - Default value (null means no default - skip)
Throws:
RDFException

removeProperty

public static void removeProperty(Model model,
                                  RDFNode rdftype,
                                  Property prop)
                           throws RDFException
Remove a property for a specific type of Component.

Parameters:
model - Model
rdftype - RDF.type of Component (null means all)
prop - Property to remove
Throws:
RDFException


Copyright © 2003 SCAM. All Rights Reserved.