com.hp.hpl.jena.eyeball.inspectors
Class ListInspector

java.lang.Object
  extended by com.hp.hpl.jena.eyeball.inspectors.InspectorBase
      extended by com.hp.hpl.jena.eyeball.inspectors.ListInspector
All Implemented Interfaces:
Inspector

public class ListInspector
extends InspectorBase

A ListInspector looks for list types T in the model, and properties with range T. Each such property value is checked for structural integrity: each node should have exactly one rdf:first and exactly one rdf:rest.

A "list type" is rdf:List, or any subclass which looks like the typed list idiom:

        T subClassOf List
           ; subClassOf [onProperty rest; allValuesFrom T]
           ; subClassOf [onProperty first; allValuesFrom E]
    

A subclass of List defined as a subclass of any bnode which has rdf:first or rdf:rest as any property value, but is not shaped like the idiom, is deemed to be a "suspect" type, and reported.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hp.hpl.jena.eyeball.Inspector
Inspector.InspectorSet, Inspector.Operations
 
Field Summary
protected  java.util.Map<com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Resource> idiomaticListTypes
           
protected  java.util.Map<java.lang.Object,com.hp.hpl.jena.rdf.model.Resource> propertiesWithListRange
           
protected  java.util.Set<com.hp.hpl.jena.rdf.model.Resource> suspectListTypes
           
 
Constructor Summary
ListInspector()
           
ListInspector(com.hp.hpl.jena.rdf.model.Resource config)
           
 
Method Summary
 java.util.Map<java.lang.Object,com.hp.hpl.jena.rdf.model.Resource> getIdiomaticListProperties()
          Answer a map of maplets (P -> T) where P is a property with list type T as range.
 java.util.Map<com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Resource> getIdiomaticListTypes()
          Answer a map of maplets (T -> U) where T is a list type and U is the type of elements in that list.
 java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getSuspectListTypes()
          Answer the set of subclasses of List that look like they might have been intended to be defined using the typed-list idiom, but failed in some way.
 void inspectList(Report r, com.hp.hpl.jena.rdf.model.Statement s, com.hp.hpl.jena.rdf.model.Resource root)
           
 void inspectList(Report r, com.hp.hpl.jena.rdf.model.Statement s, com.hp.hpl.jena.rdf.model.Resource root, com.hp.hpl.jena.rdf.model.Resource type)
           
 void inspectModel(Report r, com.hp.hpl.jena.ontology.OntModel m)
          Inspect the model as a whole.
 void inspectStatement(Report r, com.hp.hpl.jena.rdf.model.Statement s)
          Inspect a single statement s from the model being inspected.
 
Methods inherited from class com.hp.hpl.jena.eyeball.inspectors.InspectorBase
begin, end
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idiomaticListTypes

protected final java.util.Map<com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Resource> idiomaticListTypes

propertiesWithListRange

protected final java.util.Map<java.lang.Object,com.hp.hpl.jena.rdf.model.Resource> propertiesWithListRange

suspectListTypes

protected final java.util.Set<com.hp.hpl.jena.rdf.model.Resource> suspectListTypes
Constructor Detail

ListInspector

public ListInspector(com.hp.hpl.jena.rdf.model.Resource config)

ListInspector

public ListInspector()
Method Detail

getIdiomaticListTypes

public java.util.Map<com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Resource> getIdiomaticListTypes()
Answer a map of maplets (T -> U) where T is a list type and U is the type of elements in that list. Do not alter this map. The map will be empty until inspectModel has been invoked.


getIdiomaticListProperties

public java.util.Map<java.lang.Object,com.hp.hpl.jena.rdf.model.Resource> getIdiomaticListProperties()
Answer a map of maplets (P -> T) where P is a property with list type T as range. Do not alter this map. The map will be empty until inspectModel has been invoked.


getSuspectListTypes

public java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getSuspectListTypes()
Answer the set of subclasses of List that look like they might have been intended to be defined using the typed-list idiom, but failed in some way.


inspectModel

public void inspectModel(Report r,
                         com.hp.hpl.jena.ontology.OntModel m)
Description copied from interface: Inspector
Inspect the model as a whole. This is an opportunity to perform arbitrary queries over the model's statements and associated entities, eg its prefix-mappings.

Specified by:
inspectModel in interface Inspector
Overrides:
inspectModel in class InspectorBase

inspectStatement

public void inspectStatement(Report r,
                             com.hp.hpl.jena.rdf.model.Statement s)
Description copied from interface: Inspector
Inspect a single statement s from the model being inspected. The order of the statements is not specified.

Specified by:
inspectStatement in interface Inspector
Overrides:
inspectStatement in class InspectorBase

inspectList

public void inspectList(Report r,
                        com.hp.hpl.jena.rdf.model.Statement s,
                        com.hp.hpl.jena.rdf.model.Resource root)

inspectList

public void inspectList(Report r,
                        com.hp.hpl.jena.rdf.model.Statement s,
                        com.hp.hpl.jena.rdf.model.Resource root,
                        com.hp.hpl.jena.rdf.model.Resource type)