SHAME - Standardized Hyper Adaptible Metadata Editor


The explicit method

// Initialize a QueryTarget which is the source of metadata.
Model rdfGraph = ModelFactory.createDefaultModel();
Resource resource = rdfGraph.createResource("");
QueryTarget qt = new JenaModelQueryTarget(rdfGraph, resource, null);

// Initialize an Annotation Profile which is the basis for what and how to edit / present.
new AutoDetectFormletConfigurationSets();
Formlet ap = FormletStore.getInstance().getFormlet("annotationProfileURI");

// Use a QueryEngine to bind metadata into a VariableBindingsSet
// according to the needs of the Annotation Profiles FormTemplate (QueryModel).
GraphPatternQueryEngine qe = new GraphPatternQueryEngine(new JenaRDFEngine(null));
VariableBindingSet vbs = qe.execute(ap.getQueryModel(), qt);

// Create a FormModel from the VariableBindingSet according to the 
//Annotation Profiles FormTemplate.
FormModel fm = new FormModelImpl(vbs, ap.getFormTemplate());

// Now the GUI is generated from the FormModel via an EditForm (allows editing) 
// displayed in a frame (SingleFrameFormContainer).
EditForm form = new EditForm(new SingleFrameFormContainer(), "A dummy Editor", ap.getQueryModel());
form.create(fm, null); 

The simplified method