jmvanel / semantic_forms Goto Github PK
View Code? Open in Web Editor NEWForm generators leveraging semantic web standards (RDF(S), OWL, SPARQL , ...
License: Other
Form generators leveraging semantic web standards (RDF(S), OWL, SPARQL , ...
License: Other
Currently it's possible to change the rdf:type of something,
but within a large pull-down menu.
The sub-classes of current rdf:type,
and other possible types by rdfs:subPropertyOf inference,
should appear in first position in the pull-down menu.
Need some explaination on this one.
It is convenient for non Turtle experts to be able to create forms by a specific UI. In fact we will reuse and extend the existing form generator.
There is a small vocabulary for form specifications here:
https://github.com/jmvanel/semantic_forms/blob/master/vocabulary/forms.owl.ttl
So the feature amount to use a specific form specification for creating form specifications, kind of eating our own dog food https://en.wikipedia.org/wiki/Eating_your_own_dog_food .
More than that, there is a step to pre-populate the desired form specification from the associated OWL class, After selection of an OWL class, the possible properties obtained by existing algorithm for form inference are added to the edited form specification.
This feature depends on feature "Edit an RDF list" #22 , because fields in a form are essentially ordered, which are copied hereafter:
IN FRENCH:
Cas d'utilisation créer formulaire :
As a consequence,
when doing a demonstration on localhost,
and internet is slow or not accessible,
the application becomes slow,
because there is a timeout and
the bootstrap JS library is not found from Internet.
The bootstrap JS library should be copied in
scala/forms_play/public/javascripts
Write a main() to merge FOAF persons having same givenName and familyName.
The kept subject URI will be in a given named graph,
and all triples
?DUP_URI ?P ?O .
will be removed and corresponding triples
?KEPT_URI ?P ?O .
will be created.
A single SPARQL update should do the job.
They should be updated when the URI is edited.
The class label should be in last choice.
The labels of referenced URI's should be scanned for labels.
But that does not necessarily load them in main TDB .
Rather put these graphs in a secondary TDB.
Later there can be an optimization: when users clicks on a referenced URI, the graph in secondary TDB is transfered to main TDB , thus saving a download .
Leverages on #19
instead of using the embedded TDB SPARQL engine.
This will enable easy combination with other applications backed by an SPARQL HTTP server.
It may need a new capability in Banana-RDF: wrap a SPARQL HTTP server as a graph store.
I cannot get semantic_forms to work on a new machine, because after having cloned the repository plus the banana-rdf associated one (and executed the publishLocal on banana-rdf), I only get the following information from the 'run' command execution:
[semantic_forms_play] $ run
[info] Compiling 70 Scala sources to /home/balessan/workspace/semantic_forms/scala/forms/target/scala-2.11/classes...
[error] File name too long
[error] one error found
error Compilation failed
[error] Total time: 7 s, completed 9-Nov-2015 6:37:36 PM
Do you have any idea what's going on based on that ? I am kind of stuck...
In method RDFCacheAlgo.lastModified() ,
we use only the headers
"Last-Modified" and "Date" ,
when we should also use Etag (and store it), for the case when other headers are not present.
Etag per se does not give any information about the date, but used in conjunction with "Last-Modified" that is stored in database,
a notion of "last accessed" can be computed.
By JavaScript
There is an example with Google API:
https://github.com/jmvanel/semantic_forms/blob/master/scala/social_web/src/test/scala/WSClient.scala
Add basic login for simple authentication and access control
Display
A solution is to use a named graph for each user
Compare Scala code:
FormModule, FormSyntaxFactory, Form2HTML
and form RDF specification:
https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/form_specs/foaf.form.ttl
https://github.com/jmvanel/semantic_forms/blob/master/vocabulary/forms.owl.ttl
to other frameworks, and try to get some good ideas and be more feature complete and developper friendly:
After having chosen an URI in the pulldown menu,
and clicking on the + button,
it is not possible to add another URI from the pulldown menu.
The chosen value should be put in the nearby input field,
and the pulldown menu reset to no value.
Be able to enter prefixed URI e.g.
foaf:Project
in several places:
Ideally, there should be completion .
Leverage on http://prefix.cc ,
either the web service or the TTL file ;
EulerGUI already does that.
NOTE: there is currently no API in Banana for Managing RDF prefixes,
but Jena TDB has one.
Depend on "Remove Jena dependencies in code" #21
Add a "like" check box to each item in logged mode.
Counting the triples
?S form:like true .
will allow to order search results.
Contrary to normal domain predicates, the "like" triples from other users will not be displayed.
Hi,
Can you implement DELETE ind LDP ?
Thanks ;-)
Yannick
For a form about subject <s1> , show "inverse" triples :
?S <p> <s1>.
for selected properties <p> .
These properties will be declared in form specification by:
<myForm> form:showReverseProperties ( <p> ).
borrow from https://github.com/deductions/corporate_risk ,
but use semantic_forms forms.
Use Any23 from Apache.org .
Any23 works well in command line.
DBPedia lookup is a nice Web service with completion plugged on dbpedia.
An input field based on DBPedia lookup would be well suited for foaf:interest, and many others.
Indeed most subjects of interest to people are in dbPedia encyclopedia !
DBPedia lookup in fact is a nice entrance Door to Linked Data.
It both disambiguates concepts and provides a well known URI for them.
DBPedia lookup is already used in EulerGUI here:
http://svn.code.sf.net/p/eulergui/code/trunk/eulergui/src/main/scala/deductions/runtime/dbpedia/Lookup.scala
but probably the implementation in semantic_forms will be purely in JavaScript.
use HTTP HEAD to distinguish RDF content types and others for URI's linked to current URI
RDF list are the default RDF way of specifying ordered lists.
The HTML form generation mechanism already has the ability to display and save user edits for triples that do not necessarily have the same subject.
Mainly what is needed for editing an RDF list inside a larger form:
So that relevant predicates are displayed in the form.
One use case is switching to a classical CMS workflow, where article proposals are only visible by content managers.
User U1 must not be able to access data of user U2. We don't need for now a complete Access Control mechanism, like in Virtuoso. A simple API must give access to a Banana-RDF graph store ( dataset ) that contains only data of user U1, and contains also background knowledge and ontologies. This way, it is not possible that a badly writen SPARQL query accesses data of other users. This API could leverage on this utility to create such an in-memory graph store:
trait DatasetUtils[Rdf <: RDF]
extends DatasetFactory
with RDFOpsModule {
/** merge given datasets */
def merge(datasets: Seq[Dataset]) : GraphStore[Rdf, Try, Dataset]= {
This API could be:
def makeUserDataset( userURI:string ) : GraphStore[Rdf, Try, Dataset]
leveraging on Banana-RDF.
Search also by going through URI's
that is, search for "jazz" must also find:
<a> <p> <http://mysite.com/x#jazz>
# and
<a> <p> <http://mysite.com/x/jazz>
This is to be implemented by JavaScript ( or Scala.JS ).
Later we will need date, telephone, ...
Currently CSS classes for labels and fields are hard coded;
they should be configurable via RDF in the database.
HTML generation occurs in Forms2HTML .
Be able to check in the browser user input for integer intervals.
An example of corresponding OWL declaration is:
:interval-1-5 a rdfs:Datatype;
owl:onDatatype xsd:integer;
owl:withRestrictions (
[xsd:minInclusive 1] [xsd:maxInclusive 5] ) .
Possibly add FlintSPARQLEditor, but this implies to launch SPARQL HTTP server like Fuseki, or BigData, or to use the SPARQL protocol in the semantic_forms server
The use case is to display sub-forms as tabs or in place with HTML5 popup.
The typical case in RDF data modeling is the adress associated to a Person.
The adress will generally not be reused by another Person.
In the ontology, this is detectable by the property being owl:FonctionalProperty.
For instance, VIE seems to do the job
https://github.com/bergie/VIE
but :
This is the case for foaf:img,
that would give the user 2 choices:
In case 1, the binary file should somehow be stored:
modularize Play application :
separate the CRUD + navigate application and the raw services for forms to display, edit, and create
( maybe borrow from https://github.com/deductions/corporate_risk )
see https://www.playframework.com/documentation/2.3.x/SBTSubProjects
The MIME types in URL's in /display pages could be decorated with icons.
This needs to keep track of the MIME types in one of the TDB's .
This is the same thing for IP's, host names , and user URI's .
What about these icons ?
https://github.com/pasnox/oxygen-icons-png/tree/master/oxygen/22x22/mimetypes
Currently we use the HTML + HTTP form encoding for sending the user data to server.
This is fragile, not elegant, not semantic. The user is actually editing triples, we should send triples. Here is an example of the current situation:
<div> <input
class="form-control"
value="http://jmvanel.free.fr/images/jmv_id.jpg"
name="RES-http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fimg">
</input>
<input
value="http://jmvanel.free.fr/images/jmv_id.jpg"
name="ORIG-RES-http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fimg" type="hidden">
</input>
</div>
We are transmitting these elements:
We will need:
cf my post on Jena list:
http://mail-archives.apache.org/mod_mbox/jena-users/201507.mbox/%[email protected]%3E
When saving <uri1>
,
must delete existing triples
<uri1> ?P1 _:bn11Old .
_:bn11Old . ?P2 ?O2 .
when _:bn11Old has a display label equal to the one of incoming blank node _:bn11 such that:
<uri1> ?P1 _:bn11 .
Use cases:
This seems a job for an auxiliary LDP server, se implementations here:
http://www.w3.org/wiki/LDP_Implementations
We need something in Scala at least for JVM, so that the installing procedure is not too complex.
This one seems suitable
http://www.w3.org/wiki/LDP_Implementations#Fedora_Commons_Repository_.28Client_and_Server.29
But this is probably a J2EE web server, but with Play! we are not J2EE .
Or this one, which is simple, but also J2EE:
https://github.com/regestaexe/bygle-ldp
Marmotta is well know http://marmotta.apache.org/ , but it's also J2EE, and I doubt it's modular enough; we have already the LDP+SPARQL stuff.
Or using RWW_Play_Server http://www.w3.org/wiki/LDP_Implementations#RWW_Play_Server could be a solution, but again it seems not very modular. However, it has the advantage to be backed by a simple file based storage. We would need this , and this alone.
Systematically add rdfs:label and rdfs:comment when there is no form specification .
Consider this property définition in Turtle:
av:contributes a owl:ObjectProperty ;
rdfs:label "contribue"@fr ;
rdfs:domain av:Actor ;
rdfs:range foaf:Project .
# ...
av:Project rdfs:subClassOf foaf:Project.
We need the rdfs:range foaf:Project , so that the application will propose all foaf:Project instances to the user for choosing as values of av:contributes .
However, when creating from scratch a value for av:contributes in the context of a new instance of av:Actor, we would like to be specific , and create an instance of av:Project , not foaf:Project.
To specify this in the form config, I propose this syntax:
<personForm>
form:classDomain av:Person ;
form:showProperties (
foaf:givenName foaf:familyName
# ...
[ form:property av:contributes ;
form:creationClass av:Project ]
) .
What to display ?
What I created, displayed, modified;
either in a table view sorted by timestamp, or in a timeline leveraging on http://visjs.org
( CHAP Links Library http://almende.github.com/chap-links-library/timeline.html
has a successor and is no longer actively developed. The successor of the library is vis.js )
Pre-requisite: currently what a user displays is not recorded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.