# Simple Data Entry Form for Filesystems or DBMS Interaction

**URL:** <https://forum.solidproject.org/t/simple-data-entry-form-for-filesystems-or-dbms-interaction/2153>\
**Category:** Ideas for Solid Apps\
**Created:** [August 20, 2019, 3:27pm UTC](https://forum.solidproject.org/t/simple-data-entry-form-for-filesystems-or-dbms-interaction/2153 "2019-08-20T15:27:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kidehen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/kidehen/32/42_2.png) [@kidehen](https://forum.solidproject.org/u/kidehen)\
**Post date:** [August 20, 2019, 3:27pm UTC](https://forum.solidproject.org/t/simple-data-entry-form-for-filesystems-or-dbms-interaction/2153/1 "2019-08-20T15:27:58Z")

</div>

**Problem**

Applications need to provide their end-users with full control over profile information in order to negate the deeply complex burden of end-user privacy – a major challenge currently afflicting all Web Applications.

**Solution**

HTML5, CSS, and Javascript based Application that leverages the Solid Authentication Client (solid-auth-client) component for Identity Authentication that loosely-bound to a variety of OpenID Connect compliant Identity Providers.

**Solution Example**

A simple Data Entry Form that satisfies the following conditions.

- Supports the age-old Model, View, and Controller ([MVC](http://dbpedia.org/resource/Model%E2%80%93view%E2%80%93controller)) pattern — where Entity-\>Attributes-\>Values ([EAV](http://dbpedia.org/resource/Entity%E2%80%93attribute%E2%80%93value_model)) oriented 3-Tuples handle the Model, HTML and CSS handle the View, Javascript handles the Controller — without the usual imposition of some framework on the process before you get started
- Supports References of Literal Values for input — including language tagged literals for multilingual labeling and general annotation
- Loosely-couples [Identity](http://data.openlinksw.com/oplweb/glossary-term/Identity#this), [Identification](http://dbpedia.org/resource/Identification_%28information%29), [Authentication](http://dbpedia.org/resource/Authentication), [Authorization](http://dbpedia.org/resource/Authorization), and [Storage](http://dbpedia-live.openlinksw.com/resource/Data_storage)
- Discovers default Storage Preferences via User Profile information while also allowing defaults to be overruled
- Enables data to be saved to either a Database Management System (DBMS) or a Filesystem (a Solid Pod).

![](https://dub1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/b/b334dbe5a1ac22bed2a82e461530499e4b63a94b.gif)

### Form Usage Example

For this exercise, the system has to be capable of productively enabling a user to describe the concept “Linked Data”, along the following lines:

1. Concept Identifier — an HTTP URI from DBpedia
2. Preferred Label — using `skos:prefLabel` and language-tagged literals covering at least three national languages, e.g., English, French, German, Chinese, Japanese, etc.

An example solution is depicted in the image below.

 ![54%20AM](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/e/e7a6f9a6f8bfdc00cf403bd5ce4c8e2ee3e3891a.png)

### Component Breakdown

#### SPARQL Query Service Endpoint

Across DBMS and Filesystem operations, this service handles the following operations:

- Data Entry Validation — accepted Object Field values for a given Predicate Field input e.g., [foaf:name](http://linkeddata.uriburner.com/describe/?url=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2Fname&invfp=IFP_OFF&sas=SAME_AS_OFF&distinct=1) accepts a Literal Value while [owl:sameAs](http://linkeddata.uriburner.com/describe/?url=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23sameAs&invfp=IFP_OFF&sas=SAME_AS_OFF&graph=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl&distinct=1) accepts a Reference Value
- Data Definition (DDL) and Data Manipulation (DML) operations

#### Document Names

A default [Document Name](http://data.openlinksw.com/oplweb/glossary-term/DocumentName#this) is determined at application initialization time. This identifier is determined by looking up preferences from the application-users profile document after successful login, or set to a preset value associated with an Attribute-based Access Control (ABAC or WebACLs) associated with the default SPARQL Query Service endpoint.

This setup also implies that changing the target SPARQL Query Service endpoint requires existence of a default Document Name and associated ABAC-ACL for smooth operation.

For DBMS mode, the Data Source Name references the target of [SPARQL INSERT and DELETE](https://www.w3.org/TR/sparql11-update/#deleteInsert) operations scoped to a DBMS hosted Document Name (or [Named Graph](http://data.openlinksw.com/oplweb/glossary-term/NamedGraph#this) in SPARQL parlance).

For Filesystem mode, the Data Source Name is a reference to an actual RDF-Turtle Document (default is “mydata.ttl”) associated with a default folder name.

#### Input Field Values Handling

- A single word entry is treated as a Relative URIs scoped to the deployment document are presumed for single word values entered into any of the input files
- [CURIES](https://www.w3.org/TR/2010/NOTE-curie-20101216/) are accepted, if targeting a Virtuoso instance, due to the fact that this DBMS includes preloaded namespaces per DBMS instance

_Subject Field Values_

- Must be a reference (absolute or relative URI which may be quoted [using \<\>] or unquoted) or Blank Node (i.e., literals aren’t accepted)

_Predicate Field Values_

- Must be a reference

_Object Field Values_

Acceptable values include

- References (as per what’s outlined above regarding Subject and Predicate input fields)
- Literal Values (Unquoted phrases or quoted words)
- Typed Literal Values (e.g., “{literal}”^^xsd:{data-type})
- Language Tagged Quoted Literal Values (e.g., “{word-or-phrase}”[@en](http://twitter.com/en)
- Blank Nodes

### Important Note regarding Solid Pods

- App currently sets a “mydata.ttl” default document in your inbox folder – this is a private document, so the Virtuoso Sponger Middlerware can’t access it when trying to display the effects of your insert or delete operations

- You can replace the default target document name with a URL that identifies any document in your Solid Pod – e.g., one that provides read access to public, if you want to enjoy the effects of seeing your changes in the data table, as they occur.

### Conclusion

You can use Solid to simplify the development and deployment of Single Page Applications where end-user privacy is protected by loosely-coupling identity, identification, authentication, authorization, and storage.

As demonstrated, a Single-Page Application can use the power of Linked Data to determine end-user preferences (e.g., storage) by looking up WebID-Profile documents via WebID de-reference.

### Related

- [Deceptively Simple Data Entry form](https://openlinksoftware.github.io/single-page-apps/data-entry-form.html) — satisfying all the conditions outlined in this post
- [Git Pages Deployment](https://openlinksoftware.github.io/single-page-apps/data-entry-form.html)
- [Github Repository](https://github.com/OpenLinkSoftware/single-page-apps)
- [One of many YouTube hosted screencasts related to this data entry form](https://youtu.be/D7zrvItqGHI)
- [Virtuoso](https://virtuoso.openlinksw.com/) — a sophisticated Multi-Model DBMS and Data Virtualization platform
- [URIBurner](https://linkeddata.uriburner.com/) — a live instance of Virtuoso that provides data query and transformation services expoited by the data entry form
- [JSON Serialization for SPARQL SELECT Queries](https://www.w3.org/TR/sparql11-results-json/) – W3C Spec

---

<div class="post-metadata">

**Author:** ![codenamedmitri](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/codenamedmitri/32/169_2.png) [@codenamedmitri](https://forum.solidproject.org/u/codenamedmitri)\
**Post date:** [August 20, 2019, 3:39pm UTC](https://forum.solidproject.org/t/simple-data-entry-form-for-filesystems-or-dbms-interaction/2153/2 "2019-08-20T15:39:32Z")

</div>

Nicely done!

---

<div class="post-metadata">

**Author:** ![kidehen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/kidehen/32/42_2.png) [@kidehen](https://forum.solidproject.org/u/kidehen)\
**Post date:** [August 20, 2019, 3:51pm UTC](https://forum.solidproject.org/t/simple-data-entry-form-for-filesystems-or-dbms-interaction/2153/3 "2019-08-20T15:51:31Z")

</div>

Thanks!

It took the combined effort of a very determined intern and support from the OpenLink Team to navigate all the distracting riddles associated with this quest 🙂

This is also a nice QA tool regarding Solid Authentication and WebACLs too! Really saves time etc…
