-
Notifications
You must be signed in to change notification settings - Fork 4
Wesby 2.0 Lab Notebook
This document will act as a lab notebook for the development of Wesby.
Happy new year! 🎆
Wesby will include a search engine that will retrieve resources based on text queries input by the user. In the first iteration the search engine will search the resources by its label. Some sort of ranking system will be needed to decide which resources are more relevant. A next step will be to search not only by label but also by resource type (rdf:type for example). Extending this functionality, Wesby could search resources by label and any kind of properties, not only its type. This basic search engine can be easily built translating GET requests to SPARQL queries. Something like the following:
http://example.org/data/search?q=query&qp=property&type=type
http://example.org/data/search?q=Bob&qp=foaf:name&type=foaf:Person
SELECT ?label WHERE {
?q a foaf:Person .
?q foaf:name ?label
FILTER regex(?label, "Bob", "i")
}
http://example.org/data/search?q=Bob&p=foaf:name&tp=dct:subject&to=dbc:Living_people
SELECT ?label WHERE {
?q dct:subject dbc:Living_people .
?q foaf:name ?label
FILTER regex(?label, "Bob", "i")
}
Finally, it should implement a full text search engine. This could be achieved using a RDF index, using Apache Lucene or a similar technology.
{{#with this}}
<h1>{{@graph.label}}</h1>
<h2>Properties</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
<tr>
{{#[@graph]}}
{{#each this}}
<tr>
<td>{{[@context].xsd}}{{@key}}</td>
<td>{{this}}</td>
</tr>
{{/each}}
{{/[@graph]}}
</table>
{{[@context].xsd}}
{{/with}}
In the previous version, Wesby matches each resource to its template using the rdf:type
property. If this property doesn't exist, or there is no matching template, it applies the default template.
This system faces several problems: What happens when a resource has more than one type? We could select a random one, and maybe give the user the option to choose the most appropriate. What if this property is wrong? It may mess up the template, or apply the wrong one.
As of Wesby 2.0, we've come up with a better alternative:
Each template will have a corresponding SHACL shape, and Wesby will try to match the resources against them using ShExcala. This library will report which shape matches the resource, so we can just apply the corresponding template. What if the resource doesn't match any shape? It will just apply the default shape, just like the previous version. It may well be that the resource is supposed to be of a certain type but it has an error. In this case, it won't match any shape, but it won't fail rendering either.
####Matching: val schema = Schema.fromFile("path", "SHEXC") es.weso.shex.Matcher(schema, rdf)
shexcala --schema issue-simple.shex --endpoint http://example.org/ds/query --node http://example.org/Bob
shexcala -e http://example.org/ds/query -n http://example.org/issue1 -s issue-simple.shex -l http://example.org/IssueShape
shexcala --schema issues.shex --data issues.ttl
In the past few days I added more serialising formats. Now I'm adding basic support for LDPC resources (containers).
Wesby will try to comply, to the extent possible, with the LDP specification. To achieve this, I added the official W3C LDP test suite to the project and will gradually implement the different tests. My goal is not to make a perfect implementation of the LDP but I will try to stick to the standards.
The query engine will have methods that query the SPARQL endpoint and return the results as Rdf#Solutions or Rdf#Graph. Later, this solutions will be rendered in the suitable format for the requested MIME type. Today, I added a plain text renderer and modified the select queries.
I added an early prototype of text/plain dereferencing.
cd fuseki
fuseki-server --update --loc=ds /ds
I'm evaluating if Wesby should implement the Linked Data Platform. It makes sense since Wesby works on RDF resources (it always retrieves the HTML representation of an RDF resource). Furthermore, one of the goals for version 2.0 is the ability to edit this resources from within the browser. This could be achieved using using HTTP methods like the LDP specification describes.
I created a docs branch for Read The Docs documentation.
Travis is working again. I added a simple QueryEngine to test Banana-RDF. It's working.
The new system will have i18n, so I created a few messages files and set up i18n in the project. It is working fine. I also rethought the URI dereferencing strategy followed in 1.0. The old system used URIs did dereferencing like this:
http://example.org/resource/subject --303-->
The new system will do it like this:
http://example.org/resource/subject --303-->
The rationale behind this is based in the Cool URIs guidelines described here.
- Add i18n
- Add routes for the new dereferencing
Turns out Travis is not working...
In the next months I will rewrite Wesby from scratch.
The new system will be written in Play Framework 2.4.0, with Banana-RDF.
- Cean up of the old repository (old branches etc.)
- New 2.0 branch.
- Project created.
- Add Travis.
by WESO