se.kmr.scam.rdf.util
Class Clean

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

public class Clean
extends Object

Helper for cleaning RDF models.

Title:

Description:

Copyright: Copyright (c) 2002

Company:

Version:
$Revision $
Author:
jand

Field Summary
protected static org.apache.log4j.Category LOG
          Log4j-logger
 
Constructor Summary
Clean()
           
 
Method Summary
static void main(String[] args)
           
static Model replace(Model m)
          Replace all nodes in a Model.
static Model sweep(Model m)
          Remove all non-valued branches in Model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

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

Constructor Detail

Clean

public Clean()
Method Detail

sweep

public static Model sweep(Model m)
                   throws RDFException
Remove all non-valued branches in Model. A branch is considered valued when the "leafs" are either NA-resources or non-empty Literals.
Note: A resource having ONLY a RDF.type property is considered non-valued!

Parameters:
m - Model
Returns:
Model - same as param m
Throws:
RDFException

replace

public static Model replace(Model m)
                     throws RDFException
Replace all nodes in a Model. All anonymous resources (bNodes) will be "replaced" by new ones and NA-resources will be changed to ""-resources. Literals will be set to empty String (language is preserved). The only value (object) that is preserved is that pointed to by RDF.type.

Returns:
Model - same as param m
Throws:
RDFException
To do:
Only reuse RDF.type objects?, What if RDF.type has its own sub-model?

main

public static void main(String[] args)


Copyright © 2003 SCAM. All Rights Reserved.