se.kmr.scam.rdf.util
Class SubModel

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

public class SubModel
extends Object

Helper for extracting/manipulating sub-models from a model.

Title:

Description:

Copyright: Copyright (c) 2002

Company:

Version:
$Revision $
Author:
jand

Field Summary
static int FULL
           
static int LOCAL
           
protected static org.apache.log4j.Category LOG
          Log4j-logger
static int MAX
          Maximum recommended depth to avoid "infinite" loops.
static int SINGLE
           
 
Constructor Summary
SubModel()
           
 
Method Summary
static Statement duplicate(Model model, Statement stm)
          Create and add a duplicate of the branch marked by stm.
static Model getHierarchy(Model model, Model buffer, Resource res, int itemDepth, int resDepth)
          Retrieve sub-hierarchy from res:s point of view.
static Model getModel(Model model, Model buffer, Resource res)
          Retrieve local sub-model from res:s point of view.
static Model getModel(Model model, Model buffer, Resource res, int depth)
          Retrieve sub-model from res:s point of view.
static void main(String[] args)
           
static void remove(Model model, Resource res)
          Remove resource and its sub-model from model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL

public static final int LOCAL
See Also:
Constant Field Values

SINGLE

public static final int SINGLE
See Also:
Constant Field Values

FULL

public static final int FULL
See Also:
Constant Field Values

MAX

public static final int MAX
Maximum recommended depth to avoid "infinite" loops.

See Also:
Constant Field Values

LOG

protected static org.apache.log4j.Category LOG
Log4j-logger

Constructor Detail

SubModel

public SubModel()
Method Detail

getModel

public static Model getModel(Model model,
                             Model buffer,
                             Resource res)
                      throws RDFException
Retrieve local sub-model from res:s point of view.

Parameters:
model - Source Model
buffer - Buffer-model
res - "Root"
Returns:
Sub-model - same as param buffer
Throws:
RDFException - Description of the Exception
See Also:
getModel(Model, Model, Resource, int)

getModel

public static Model getModel(Model model,
                             Model buffer,
                             Resource res,
                             int depth)
                      throws RDFException
Retrieve sub-model from res:s point of view.

Parameters:
model - Source Model
buffer - Buffer-model
res - "Root"
depth - traverse-depth of Resource (Metadata)
Returns:
Sub-model - same as param buffer
Throws:
RDFException - Description of the Exception

getHierarchy

public static Model getHierarchy(Model model,
                                 Model buffer,
                                 Resource res,
                                 int itemDepth,
                                 int resDepth)
                          throws RDFException
Retrieve sub-hierarchy from res:s point of view. res should be an IMSCP Container.

Parameters:
model - Source Model
buffer - Buffer-model
res - "Root"
itemDepth - traverse-depth of Hierarchy/Items (Organization)
resDepth - traverse-depth of Resource (Metadata)
Returns:
Sub-model - same as param buffer
Throws:
RDFException - Description of the Exception
To do:
Need to check IMS Container?

remove

public static void remove(Model model,
                          Resource res)
                   throws RDFException
Remove resource and its sub-model from model

Parameters:
model - Model
res - Resource to remove
Throws:
RDFException
To do:
Check if IMSCP Container?

duplicate

public static Statement duplicate(Model model,
                                  Statement stm)
                           throws RDFException
Create and add a duplicate of the branch marked by stm. If the subject of that statement is an RDF-Container the duplicate will be inserted at current ordinal+1. Values (leaf-nodes) are NOT duplicated. Language of duplicated (empty) Literals are preserved.

Parameters:
model - Model
stm - Statement of branch to be duplicated.
Returns:
the Statement marking the duplicated branch.
Throws:
RDFException

main

public static void main(String[] args)


Copyright © 2003 SCAM. All Rights Reserved.