org.topbraid.sparqlmotion.util
Class SMUtil

java.lang.Object
  extended by org.topbraid.sparqlmotion.util.SMUtil

public class SMUtil
extends java.lang.Object


Constructor Summary
SMUtil()
           
 
Method Summary
static void addConnectedModules(com.hp.hpl.jena.rdf.model.Resource config, java.util.Set<com.hp.hpl.jena.rdf.model.Resource> configs)
          Traverses a module graph and adds all config nodes linked through sm:next.
static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getTargetModules(com.hp.hpl.jena.rdf.model.Model model)
           
static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getTargetModules(com.hp.hpl.jena.rdf.model.Resource module)
          Gets all target modules of the script containing a certain module.
static boolean isNestedModule(com.hp.hpl.jena.rdf.model.Resource config)
          Checks whether a given module config is part of a nested block, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMUtil

public SMUtil()
Method Detail

addConnectedModules

public static void addConnectedModules(com.hp.hpl.jena.rdf.model.Resource config,
                                       java.util.Set<com.hp.hpl.jena.rdf.model.Resource> configs)
Traverses a module graph and adds all config nodes linked through sm:next.

Parameters:
config - the configs to get
configs - the Set of configs to add into

getTargetModules

public static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getTargetModules(com.hp.hpl.jena.rdf.model.Model model)

getTargetModules

public static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getTargetModules(com.hp.hpl.jena.rdf.model.Resource module)
Gets all target modules of the script containing a certain module.

Parameters:
module - the config of the module to start with
Returns:
a Set of target modules (may contain module)

isNestedModule

public static boolean isNestedModule(com.hp.hpl.jena.rdf.model.Resource config)
Checks whether a given module config is part of a nested block, i.e. whether one of its siblings is object of an sm:body property.

Parameters:
config - the config to start exploring
Returns:
true if config is nested, false for top-level modules