Skip to content

Commit

Permalink
Merge pull request #4 from thecloudcircle/v7
Browse files Browse the repository at this point in the history
V7
  • Loading branch information
alexcracea authored May 26, 2022
2 parents 181b7f2 + 8e3d8b4 commit d29a798
Show file tree
Hide file tree
Showing 147 changed files with 140,781 additions and 3,268 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:14

# to have latest npm version
RUN npm i -g npm

# install needed npm dependancies for build step
WORKDIR /usr/src/app/
COPY package.json /usr/src/app/
COPY package-lock.json /usr/src/app/
RUN npm install
COPY . /usr/src/app/

# build sparnatural into dist/ folder
RUN npm run build

# start a http server on the dist/folder
RUN npm install -g http-server
CMD [ "http-server", "-p", "8080", "/usr/src/app/dist/"]
EXPOSE 8080
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ You can play with **online demos at http://sparnatural.eu#demos**.

To get started :

1. Read the following documentation;
2. Look at how things work in file `sparnatural-demo-dbpedia/index.html`;
3. In particular look at how the specifications are written by looking at [the source of `sparnatural-demo-dbpedia/index.html`](https://github.com/sparna-git/Sparnatural/blob/master/sparnatural-demo-dbpedia/index.html#L100)
4. Adapt `sparnatural-demo-dbpedia/index.html` by changing the configuration and adapting the SPARQL endpoint URL;
1. Read the following README;
2. Read [the documentation](https://docs.sparnatural.eu)
3. Look at how things work in file `sparnatural-demo-dbpedia/index.html`;
4. In particular look at how the specifications are written by looking at [the source of `sparnatural-demo-dbpedia/index.html`](https://github.com/sparna-git/Sparnatural/blob/master/sparnatural-demo-dbpedia/index.html#L100)
5. Adapt `sparnatural-demo-dbpedia/index.html` by changing the configuration and adapting the SPARQL endpoint URL;

To get started with docker :

1. Clone the git repository
2. Run ``docker-compose build``
3. Run ``docker-compose up``
4. Open your browser: http://127.0.0.1:8080

# Features

Expand Down Expand Up @@ -73,6 +81,10 @@ Sparnatural offers currently 6 ways of selecting a value for a criteria : autoco

![](documentation/10-list.png)

### Tree selector

![](documentation/17-tree.png)

### String value (text search)

![](documentation/11-search.png)
Expand Down Expand Up @@ -124,9 +136,9 @@ To send SPARQL queries to a service that is not hosted on the same domain name a

## Specification of classes and properties

The component is configurable using a an [OWL configuration file](https://github.com/sparna-git/Sparnatural/wiki/OWL-based-configuration) editable in Protégé.. Look at the specification files of [the demos](https://github.com/sparna-git/sparnatural.eu/tree/main/demos) to get an idea.
The component is configurable using a an [OWL configuration file](https://docs.sparnatural.eu/OWL-based-configuration) editable in Protégé.. Look at the specification files of [the demos](https://github.com/sparna-git/sparnatural.eu/tree/main/demos) to get an idea.

Alternatively one can also use a [JSON(-LD) ontology file](https://github.com/sparna-git/Sparnatural/wiki/JSON-based-configuration). A JSON(-LD) configuration file contains :
Alternatively one can also use a [JSON(-LD) ontology file](https://docs.sparnatural.eu/JSON-based-configuration). A JSON(-LD) configuration file contains :

### Class definition

Expand Down Expand Up @@ -169,7 +181,7 @@ It is possible to directly use font-awesome icons in place of icons embedded in

## How to integrate Sparnatural in a webpage

Look at [this page in the wiki documentation](https://github.com/sparna-git/Sparnatural/wiki/Javascript-integration).
Look at [this page in the documentation](https://docs.sparnatural.eu/Javascript-integration).


## Map the query structure to a different graph structure
Expand Down
64 changes: 55 additions & 9 deletions dist/index-saved-query.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
</style>

<link href="sparnatural.css" rel="stylesheet"><link href="demo-styles.css" rel="stylesheet"></head>
<link href="sparnatural.css" rel="stylesheet"></head>
<body>
<header>
<nav class="navbar navbar-expand navbar-dark bg-dark">
Expand Down Expand Up @@ -149,7 +149,8 @@
{"@value" : "Museum", "@language" : "en"},
{"@value" : "Musée","@language" : "fr"}
],
"faIcon": "fas fa-university"
"faIcon": "fas fa-university",
"defaultLabelProperty": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#auto_label"
},
{
"@id" : "http://dbpedia.org/ontology/Country",
Expand Down Expand Up @@ -226,6 +227,16 @@
],
"faIcon": "fas fa-palette"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Category",
"@type" : "Class",
"subClassOf" : "sparnatural:NotInstantiatedClass",
"label": [
{"@value" : "Category","@language" : "en"},
{"@value" : "Catégorie","@language" : "fr"}
],
"faIcon": "fas fa-palette"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Text",
"@type" : "Class",
Expand Down Expand Up @@ -405,19 +416,42 @@
{
"@id" : "http://dbpedia.org/ontology/movement",
"@type" : "ObjectProperty",
"subPropertyOf" : "sparnatural:ListProperty",
"subPropertyOf" : "sparnatural:TreeProperty",
"label": [
{"@value" : "movement","@language" : "en"},
{"@value" : "mouvement","@language" : "fr"}
],
"domain": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Person",
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Movement",
"datasource" : "datasources:list_rdfslabel_count"
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Movement"
},
{
"@id" : "http://purl.org/dc/terms/subject",
"@type" : "ObjectProperty",
"subPropertyOf" : "sparnatural:TreeProperty",
"label": [
{"@value" : "category","@language" : "en"},
{"@value" : "catégorie","@language" : "fr"}
],
"domain": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Person",
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Category",
"treeRootsDatasource" : {
"queryString" : `
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?uri ?label ?hasChildren
WHERE {
VALUES ?uri {<http://fr.dbpedia.org/resource/Catégorie:Peintre_français>}
?uri skos:prefLabel ?label .
FILTER(lang(?label) = '' || lang(?label) = $lang)
BIND(true AS ?hasChildren)
}
`
},
"treeChildrenDatasource": "datasources:tree_children_skos"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#text",
"@type" : "ObjectProperty",
"subPropertyOf" : "sparnatural:StringEqualsProperty",
"subPropertyOf" : "sparnatural:GraphDBSearchProperty",
"label": [
{"@value" : "label or description","@language" : "en"},
{"@value" : "libellé ou description","@language" : "fr"}
Expand Down Expand Up @@ -447,7 +481,7 @@
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Text"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#artwork-label",
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#a_label",
"@type" : "ObjectProperty",
"subPropertyOf" : "sparnatural:SearchProperty",
"isMultilingual" : true,
Expand All @@ -467,6 +501,17 @@
},
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Text"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#auto_label",
"@type" : "ObjectProperty",
"subPropertyOf" : "sparnatural:NonSelectableProperty",
"label": [
{"@value" : "name","@language" : "en"},
{"@value" : "nom","@language" : "fr"}
],
"sparqlString": "rdfs:label",
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Text"
},
{
"@id" : "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#unknownProperty",
"@type" : "ObjectProperty",
Expand Down Expand Up @@ -510,10 +555,11 @@
],
"domain": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Person",
"range": "http://labs.sparna.fr/sparnatural-demo-dbpedia/onto#Text"
}
},
]
}
;

</script>


Expand Down Expand Up @@ -647,5 +693,5 @@


</script>
<script type="text/javascript" src="sparnatural.js"></script><script type="text/javascript" src="demo-styles.js"></script></body>
<script type="text/javascript" src="sparnatural.js"></script></body>
</html>
Loading

0 comments on commit d29a798

Please sign in to comment.