org.ilrt.inkling.app
Class Rosco

java.lang.Object
  |
  +--org.ilrt.inkling.app.Rosco

public class Rosco
extends java.lang.Object

Various useful schema-checking methods. See
http://swordfish.rdfweb.org/discovery/2003/08/validation/ for the online
demo.


Constructor Summary
Rosco()
           
 
Method Summary
 void checkDocStatusByClass(Graph test, java.lang.String cl, java.util.Hashtable properties)
          For each class, and for a list of properties per class (in a Hash of vectors, keyed by class name), checks if instances of the property are present in Graph test.
 void checkDomainConsistancy(java.lang.String cl, java.lang.String schema)
          Checks whether each property has a consistent domain with respect to a certain class
 void checkFileConsistancy(java.lang.String cl, java.lang.String schema, java.lang.String testfile)
          This checks each node of a given type in a document, and lists the properties it could have, and does have, including superclass-related properties
 void fixNoTypes(Graph graph)
          Adds an rdf:type rdfs:Resource for each subject in a graph.
 void fixSchemaDomains(Graph schema)
          For all properties in schema without a domain, adds a domain of rdfs:Resource.
 java.util.Vector getAllClasses(Graph schema)
          Returns a list of Strings - all Classes in the schema.
 java.util.Vector getAllProperties(Graph schema)
          Gets all the properties in a given schema, returning a unique vector of Strings.
 java.util.Vector getProperties(Graph schema, java.lang.String cl)
          gets all the properties with the domain of the class cl or any of its superclasses
 java.util.Vector getPropertiesWithDomain(Graph schema, java.lang.String cl)
          Recursively gets all the properties with domain cl from the schema.
 void getSuperClasses(Graph schema, java.lang.String cl, java.util.Vector tofill)
          Reursively gets all the superclasses of the class cl from the schema schema, and adds to the Vector tofill.
 boolean hasProperty(Graph g, Node s, Node p, Node o)
          Tests if a given s,p,o triples is present ina Graph.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rosco

public Rosco()
Method Detail

main

public static void main(java.lang.String[] args)

checkDomainConsistancy

public void checkDomainConsistancy(java.lang.String cl,
                                   java.lang.String schema)
Checks whether each property has a consistent domain with respect to a certain class

checkFileConsistancy

public void checkFileConsistancy(java.lang.String cl,
                                 java.lang.String schema,
                                 java.lang.String testfile)
This checks each node of a given type in a document, and lists the properties it could have, and does have, including superclass-related properties

checkDocStatusByClass

public void checkDocStatusByClass(Graph test,
                                  java.lang.String cl,
                                  java.util.Hashtable properties)
For each class, and for a list of properties per class (in a Hash of vectors, keyed by class name), checks if instances of the property are present in Graph test.

getProperties

public java.util.Vector getProperties(Graph schema,
                                      java.lang.String cl)
gets all the properties with the domain of the class cl or any of its superclasses

getSuperClasses

public void getSuperClasses(Graph schema,
                            java.lang.String cl,
                            java.util.Vector tofill)
Reursively gets all the superclasses of the class cl from the schema schema, and adds to the Vector tofill.

getPropertiesWithDomain

public java.util.Vector getPropertiesWithDomain(Graph schema,
                                                java.lang.String cl)
Recursively gets all the properties with domain cl from the schema.

getAllProperties

public java.util.Vector getAllProperties(Graph schema)
Gets all the properties in a given schema, returning a unique vector of Strings.

hasProperty

public boolean hasProperty(Graph g,
                           Node s,
                           Node p,
                           Node o)
Tests if a given s,p,o triples is present ina Graph.

getAllClasses

public java.util.Vector getAllClasses(Graph schema)
Returns a list of Strings - all Classes in the schema.

fixSchemaDomains

public void fixSchemaDomains(Graph schema)
For all properties in schema without a domain, adds a domain of rdfs:Resource.

fixNoTypes

public void fixNoTypes(Graph graph)
Adds an rdf:type rdfs:Resource for each subject in a graph.