|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.kmr.scam.rdf.util.IMSCPUtil
Helper for IMS Content Packaging.
Title:
Description:
Copyright: Copyright (c) 2002
Company:
Field Summary | |
protected static org.apache.log4j.Category |
LOG
Log4j-logger |
Constructor Summary | |
IMSCPUtil()
|
Method Summary | |
static boolean |
addItem(Model m,
Resource parent,
Resource item)
Add sub-item to an IMS Container. |
static Resource |
createManifest(Model m,
String uri,
String defaultUri)
Create the default structure of an IMSCP Manifest, including an anonymous default IMSCP Hierarchy. |
static Resource |
getContent(Model m,
Resource item)
Get the IMSCP.content-resource of an Item |
static Resource |
getDefaultOrg(Model m)
Fetch the default IMSCP Organization resource |
static Resource |
getItemWithProperty(Model m,
Resource parent,
Property prop,
RDFNode value)
Get the sub-item (child) having the given Property-Value. |
static Resource |
getManifest(Model m)
Fetch the IMSCP.manifest resource |
static Resource |
getParent(Model m,
Resource res)
Fetch IMS Container referencing res by RDF.li. |
static boolean |
hasContainer(Model m)
Does the model contain an IMS Container? |
static boolean |
hasManifest(Model m)
See if model contains an IMS.manifest |
static boolean |
isContainer(Model m,
Resource res)
Is resource a IMSCP container, i.e. |
static boolean |
isContainer(Resource res)
|
static boolean |
isContainer(Statement stm)
|
static boolean |
isContentItem(Model m,
Resource res)
|
static boolean |
isFolder(Model m,
Resource res)
|
static boolean |
isFolderLink(Model m,
Resource res)
Check if content-Resource is a "link" to a Folder, i.e. has a property SCAM.inModel and is an IMS Folder. |
static boolean |
isLink(Model m,
Resource res)
Check if content-Resource is a "link", i.e. has a property SCAM.inModel. |
static List |
listAllItems(Model m,
Resource parent)
List all ancestors of an IMS Container. |
static List |
listContainers(Model m)
List all IMS Containers |
static List |
listItems(Model m,
Resource parent)
List sub-items of an IMS Container. |
static List |
listNonContainers(Model m)
List all resources that is NOT an IMS Container |
static List |
listNonIMSResources(Model m)
List all resources that is NOT an IMS Resource, i.e. does NOT have an RDF.type-object with IMSCP Namespace |
static List |
listReferences(Model m,
Resource res)
List IMS Items referencing res by IMSCP.content . |
static void |
main(String[] args)
|
static boolean |
removeItem(Model m,
Resource parent,
Resource item)
Remove sub-item from an IMS Container. |
static boolean |
removeParentRef(Model m,
Resource child)
Remove RDF.li parent reference. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Category LOG
Constructor Detail |
public IMSCPUtil()
Method Detail |
public static boolean isContainer(Model m, Resource res) throws RDFException
m
- Modelres
- Resource
false
if resource not found or non-container
RDFException
public static boolean isContainer(Resource res) throws RDFException
RDFException
public static boolean isContainer(Statement stm) throws RDFException
RDFException
public static boolean isFolder(Model m, Resource res) throws RDFException
RDFException
public static boolean isContentItem(Model m, Resource res) throws RDFException
RDFException
public static Resource createManifest(Model m, String uri, String defaultUri) throws RDFException
m
- Modeluri
- The Manifest URIdefaultUri
- The default hierarchy URI
RDFException
public static boolean hasManifest(Model m) throws RDFException
m
- Model
true
if so
RDFException
public static Resource getManifest(Model m) throws RDFException
m
- Model
null
if not found
RDFException
public static Resource getDefaultOrg(Model m) throws RDFException
m
- Model
null
if not found
RDFException
public static Resource getParent(Model m, Resource res) throws RDFException
res
by RDF.li.
m
- Modelres
- Resource (child)
res
RDFException
public static Resource getItemWithProperty(Model m, Resource parent, Property prop, RDFNode value) throws RDFException
m
- Modelparent
- Parent Itemprop
- Property to look forvalue
- Value of that property
null
if not found
RDFException
public static Resource getContent(Model m, Resource item) throws RDFException
m
- Modelitem
- Item
null
if not found
RDFException
public static boolean isFolderLink(Model m, Resource res) throws RDFException
m
- Modelres
- content-Resource
RDFException
public static boolean isLink(Model m, Resource res) throws RDFException
m
- Modelres
- content-Resource
RDFException
public static boolean hasContainer(Model m) throws RDFException
m
- Model
true
if so.
RDFException
public static boolean addItem(Model m, Resource parent, Resource item) throws RDFException
m
- Modelparent
- Parent IMS Containeritem
- New item.
true
if item
could be added.
RDFException
- if parent/item is NOT IMS Containerspublic static boolean removeItem(Model m, Resource parent, Resource item) throws RDFException
m
- Modelparent
- Parent IMS Containeritem
- New item.
true
if item
could be removed.
RDFException
- if parent is NOT an IMS Containerpublic static List listItems(Model m, Resource parent) throws RDFException
m
- Modelparent
- IMS Container
Collection
of Resource
s
RDFException
public static List listAllItems(Model m, Resource parent) throws RDFException
m
- Modelparent
- IMS Container
Collection
of Resource
s
RDFException
public static List listContainers(Model m) throws RDFException
m
- Model
Collection
of Resource
s
RDFException
public static List listNonContainers(Model m) throws RDFException
m
- Model
Collection
of Resource
s
RDFException
public static List listNonIMSResources(Model m) throws RDFException
m
- Model
Collection
of Resource
s
RDFException
public static List listReferences(Model m, Resource res) throws RDFException
res
by IMSCP.content .
m
- Modelres
- Resource
Collection
of Resource
s
RDFException
- Description of the Exceptionpublic static boolean removeParentRef(Model m, Resource child) throws RDFException
m
- Modelchild
- Remove reference to this Item
true
if removed
RDFException
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |