This HTML5 document contains 33 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
dctermshttp://purl.org/dc/terms/
atomhttp://atomowl.org/ontologies/atomrdf#
foafhttp://xmlns.com/foaf/0.1/
n16http://vos.openlinksw.com/dataspace/services/wiki/
oplhttp://www.openlinksw.com/schema/attribution#
n2http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
dchttp://purl.org/dc/elements/1.1/
n12http://vos.openlinksw.com/dataspace/dav#
rdfshttp://www.w3.org/2000/01/rdf-schema#
n17http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n18http://www.w3.org/2000/01/rdf-schema#label.
n4http://vos.openlinksw.com/dataspace/person/dav#
n15http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtSPASQLRDFDemoLabels/sioc.
n11http://vos.openlinksw.com/dataspace/owiki/wiki/
n20http://vos.openlinksw.com/wiki/main/VOS/VirtSPASQLRDFDemoLabels/MadridDetails.
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n6http://vos.openlinksw.com/dataspace/owiki#
xsdhhttp://www.w3.org/2001/XMLSchema#
n10http://vos.openlinksw.com/dataspace/person/owiki#
siochttp://rdfs.org/sioc/ns#
Subject Item
n4:this
foaf:made
n2:VirtSPASQLRDFDemoLabels
Subject Item
n12:this
sioc:creator_of
n2:VirtSPASQLRDFDemoLabels
Subject Item
n16:item
n17:services_of
n2:VirtSPASQLRDFDemoLabels
Subject Item
n6:this
sioc:creator_of
n2:VirtSPASQLRDFDemoLabels
Subject Item
n11:VOS
sioc:container_of
n2:VirtSPASQLRDFDemoLabels
atom:entry
n2:VirtSPASQLRDFDemoLabels
atom:contains
n2:VirtSPASQLRDFDemoLabels
Subject Item
n2:VirtSPASQLRDFDemoLabels
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:49:57.278301
dcterms:modified
2017-06-29T07:40:20.386070
rdfs:label
VirtSPASQLRDFDemoLabels
foaf:maker
n10:this n4:this
dc:title
VirtSPASQLRDFDemoLabels
opl:isDescribedUsing
n15:rdf
sioc:has_creator
n6:this n12:this
sioc:attachment
n20:png
sioc:content
%META:TOPICPARENT{name="RDFDemoExternalDereferencing"}% ---+Extending RDFDemo to Display More Compact Labels This document will guide you through extending the application created in [[VirtSPASQLRDFDemoExternalDereferencing][Extending RDFDemo to Allow Dereferencing of External IRIs.]] so that the data is displayed in a more readable form. ---+++Pre-requisites 1. A working copy of the RDFDemo application created in [[VirtSPASQLRDFDemoExternalDereferencing][Extending RDFDemo to Allow Dereferencing of External IRIs]]. ---++Extending the Application. The RDF demo application presents the user with a list of Customers from the Northwind database in the form of dereferenceable IRIs. When a customer is selected from the list the application uses a sparql query to describe that customer and the results are displayed in a form as rows of labels and data. The labels correspond to RDF predicates and the data corresponds to RDF objects while the subject is the customer initially selected. In many cases the objects are dereferencable IRIs which are then used as the subject when the 'drilling down' into the data. However, the predicates are also IRIs so it is possible to gain more information about these as well. The RDF Schema defines a property <nowiki>http://www.w3.org/2000/01/rdf-schema#label</nowiki> that may be used to provide a human-readable version of a resource's name. We can obtain further details of each of the predicates in a resultset and check to see if one of the properties is an <nowiki>http://www.w3.org/2000/01/rdf-schema#label</nowiki>. If it is we can use the associated text as the label in our form instead of the the predicate IRI. The benefit should be a more human readable form. ---+++Step 1- Add a New Method to Get the Label Text This method takes the predicate IRI and issues a sparql query to get its description. It then cycles through the returned dataset to find a http://www.w3.org/2000/01/rdf-schema#label. If there is one then the associated text is returned by the method. Otherwise the method returns the IRI string. * Add the following method to the <nowiki>ExtendedStringHandlerClass</nowiki> <verbatim> private string getLabelText(Object label) { string labelText = label.ToString(); if (label is SqlExtendedString) { SqlExtendedString se = (SqlExtendedString)label; StringBuilder getLabelCommandText = new StringBuilder("sparql define get:soft \"soft\" select * from <" + se.ToString() + "> where {<" + se.ToString() + "> ?p ?o}"); VirtuosoCommand getLabelCommand = new VirtuosoCommand(getLabelCommandText.ToString(), ParentConnection); VirtuosoDataAdapter getLabelAdapter = new VirtuosoDataAdapter(); getLabelAdapter.SelectCommand = getLabelCommand; DataSet getLabelDataSet = new DataSet(); try { getLabelAdapter.Fill(getLabelDataSet); foreach (DataRow getLabelRow in getLabelDataSet.Tables[0].Rows) { if (getLabelRow[0].ToString() == "http://www.w3.org/2000/01/rdf-schema#label") { labelText = getLabelRow[1].ToString(); break; } } } catch { } } return labelText; } </verbatim> * Change the line in <nowiki>displayData</nowiki> from <verbatim> propertyLabel.Text = row[0].ToString(); </verbatim> to <verbatim> propertyLabel.Text = getLabelText(row[0]); </verbatim> ---+++ Step 2 - Build and Run the Application When you run the application you will see that the initial form is the same. In fact, when you select the Customer you will also see that the customer details are also the same. It is only when you start exploring data outside the Northwind graph that you will see the labels in the form change. <img src="%ATTACHURLPATH%/MadridDetails.png" style="wikiautogen"/> ---++ Next Steps It is clear from running the application that the Northwind ontology does not define an http://www.w3.org/2000/01/rdf-schema#label for its members. In order to benefit from this modified version of RDFDemo we need to update our Northwind ontology so that http://www.w3.org/2000/01/rdf-schema#label is defined for each resource. The next step will be to modify our Northwind ontology. [[VirtSPASQLRDFDemoModifyNorthwind][Modifying the Northwind Ontology to Add Labels]]
sioc:id
9e2b5c12939e49e51b217fd68f15469a
sioc:link
n2:VirtSPASQLRDFDemoLabels
sioc:has_container
n11:VOS
n17:has_services
n16:item
atom:title
VirtSPASQLRDFDemoLabels
sioc:links_to
rdfs:label n2:VirtSPASQLRDFDemoExternalDereferencing n18:
atom:source
n11:VOS
atom:author
n4:this
atom:published
2017-06-13T05:49:57Z
atom:updated
2017-06-29T07:40:20Z
sioc:topic
n11:VOS