Skip to content
Jean-Marc Vanel edited this page Sep 13, 2017 · 6 revisions

Form generator

Design

There are 2 steps:

  • abstract form generation
  • HTML generation The first step generates a FormSyntax case class instance. It depends on the TDB database through the RDFStoreLocalProvider[Rdf, DATASET] trait.

The second step only depends on the FormSyntax case class.

API

An example using the API is the /login page in AuthServiceTrait.scala :

  • several forms in one HTML page
  • the form is a "pure" form, not used for RDF triples to be stored in the SPARQL database
  • the form action URI is different from the one used for "normal" RDF data forms, /save

RDF (SPARQL) cache

implemented in trait RDFCacheAlgo[Rdf <: RDF, DATASET]

User management

There are several components:

  • database TDB3/ for user And Password association
  • trait Authentication , a facade for user Authentication management; wraps the TDB database; the signin() function annotates the user graph URI as a foaf:OnlineAccount
  • the /login , /authenticate , /register , /register , /logout pages are in AuthServiceTrait.scala

Callbacks for HTTP events

The trait ServiceListener[Rdf <: RDF, DATASET] is a general callback for HTTP requests, with single abstract function:

def notifyServiceCall(request: HTTPrequest)(implicit userURI: String,
                      rdfLocalProvider: RDFStoreLocalProvider[Rdf, DATASET]): Unit

It is currently implemented by RDFLinksCounterLoadListenerClass, which is instanciated at the beginning of trait ApplicationFacadeImpl[Rdf, DATASET] . The instanciated implementations are called for page /display in trait WebPages by callAllServiceListeners(request) . They could be called for other pages or services as well.

There is another callback, SaveListener, which is instanciated at the beginning of trait ApplicationFacadeImpl[Rdf, DATASET], SaveListener[Rdf] . The implementations are:

  • TimeSeries, which builds the history database in TDB2/ : timestamps for named graphs and user entered triples
  • RDFLinksCounterListenerClass, which builds the database of RDF Links Counts in TDB

Goodies

CSV importer, ...

Clone this wiki locally