• Keine Ergebnisse gefunden

Figure 4.1: Interplay of the three major software components used inrdfedit

more possibilities of interaction. Within that DataTable users can apply alterations to the table of triples (henceforth triple-table), thus changing the RDF graph.

When the users have applied all alterations and decide to export the revised graph from the editor interface, the graph within the browser/DataTablesis sent back to Djan-go/RDFLib where it is transformed into a RDF/XML file and served as a download.

Figure 4.1 illustrates the concept just described.

You can accessrdfeditat: http://141.20.126.167/rdfedit/index/35.

4.2 rdfedit Start Page

When accessing the start page of, users are presented with four options on how to begin editing their data. Figure A.1 (p. 95) shows the rdfedit’s start page, where the user can choose among the following options:

35The source code ofrdfeditis available at:https://github.com/suchmaske/rdfedit. Ifrdfeditseems to be inaccessible, please contactoliverpohl@ibi.hu-berlin.de.

4.2 rdfedit Start Page

(a) Upload: Users can choose a local RDF/XML file from their computer and upload it tordfedit for further processing. The RDF file is stored temporarily on the server to extract triples and is deleted afterwards.

(b) Parse: Users can enter the URI of a SPARQL endpoint andrdfedit reads a limited number of triples from that endpoint, and makes them editable in the browser.

(c) Example: Users who only want to try out this web application can choose to let rdfedit load an example RDF graph that is being stored permanently and im-mutably on the server.36 Changes made in the editing interface to that RDF graph are not saved in the file on the server, so every time other users access the example route, they are being presented with the same graph and triples.

“Triability” is an important feature of new (software) products since it reduces peoples’ inhibition in using those products. They don’t need to worry whether they will actually be able to use a product. Instead, they can just try it out, notice that they are able to use the product and thus continue to do so in the future [Rogers, 2003, p. 258].

(d) New: Users can create a new, empty graph and start adding triples.

The upload, parse and example features function in a similar way. When accessing a RDF file, Django/RDFLib executes the code shown in Listing 4.1 to extract all triples from a RDF Graph object. Every triple is transformed into an ordered list, where the zeroth37 Element represents the subject, the first the predicate and the last the object of the triple. That ordered list is then appended to a list of lists, that holds all triples. That list is later utilized to construct the DataTables table.

# t y p e ( g r a p h ) = < c l a s s ’ r d f l i b . g r a p h . G r a p h ’ >

t r i p l e _ l i s t = l i s t()

for subject , p r e d i c a t e ,o b j e c t in g r a p h :

t r i p l e _ l i s t . a p p e n d ([ subject , p r e d i c a t e ,o b j e c t])

Listing 4.1: Python code to extract all triples into a list of lists

In case the user chooses to parse triples from a SPARQL endpoint, the number of results is being limited (see Listing 4.2), since most triple stores contain too many triples to be

36http://127.0.0.1:8000/rdfedit/1/spo/

37Lists in Python are zero-based, i.e. the first item of the list has the index0.

4.2 rdfedit Start Page

parsed at once by a normal web server.38 The data fetched from the SPARQL endpoint is then preprocessed to conform to RDF/JSON in order to be processed by RDFLib as a Graphobject. Then, the same procedure described for uploading RDF files is applied (see Listing 4.1).

S E L E C T *

W H E R E {? s ? p ? o } L I M I T 50

Listing 4.2: SPARQL query executed for reading triples from a SPARQL endpoint

Figure A.1 (p. 95) shows the current version of the rdfedit start page. When clicking on one of the available buttons, the corresponding actions are performed as stated in the previous paragraphs. When a RDF graph has been processed, these objects among others are forwarded to therdfedittabular interface (the other objects will be addressed at a later moment):

RDF/JSON object: This object represents the RDF graph using an easy-to-use RDF serialization. Within a browser, it is easier to handle JSON data than XML.

Changes made to the tabular interface will be reflected to that RDF/JSON object.

Triple-List: This list represents all triples within a list of ordered lists. It is used to generate the tabular interface ofrdfedit.

Namespace dictionary: Therdfeditsettings file contains a namespace dictionary which is used at various points of the application. For once, it helps RDFLib to parse RDF graphs by registering namespaces and thus making abbreviated URIs recognizable. Within the user interface it is used to abbreviate long URIs and make them more human-readable (like: dbpedia:Wil_Wheaton).

Subject/Predicate/Object Sets: Django builds sets (lists of unique items) for all occurring subjects, predicates and objects. These are passed on to enable auto-completion during the addition of new queries. Since it is very likely that some subjects and predicates (and objects) occur multiple times within a RDF graph, users can start typing the URI or literal, whilerdfeditfilters these sets for substring matches. Furthermore, the short namespace-keys of the namespace dictionary (e.g. dc:) are appended to each set. Users can then choose the match of their preference and thus save time when adding new triples.

38The limit number is set to 50 for demonstration purposes and can be increased at any time by editing therdfeditsource code.