Not logged in : Login

About: VirtSPASQLRDFDemoLabels     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : ods.openlinksw.com associated with source document(s)

AttributesValues
type
Date Created
Date Modified
label
  • VirtSPASQLRDFDemoLabels
maker
Title
  • VirtSPASQLRDFDemoLabels
isDescribedUsing
has creator
attachment
  • http://vos.openlinksw.com/wiki/main/VOS/VirtSPASQLRDFDemoLabels/MadridDetails.png
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 http://www.w3.org/2000/01/rdf-schema#label 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 http://www.w3.org/2000/01/rdf-schema#label. 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 ExtendedStringHandlerClass 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; } * Change the line in displayData from propertyLabel.Text = row[0].ToString(); to propertyLabel.Text = getLabelText(row[0]); ---+++ 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. ---++ 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]]
id
  • 9e2b5c12939e49e51b217fd68f15469a
link
has container
http://rdfs.org/si...ices#has_services
atom:title
  • VirtSPASQLRDFDemoLabels
links to
atom:source
atom:author
atom:published
  • 2017-06-13T05:49:57Z
atom:updated
  • 2017-06-13T05:49:57Z
topic
is made of
is container of of
is link of
is http://rdfs.org/si...vices#services_of of
is creator of of
is atom:entry of
is atom:contains of
Faceted Search & Find service v1.17_git132 as of May 12 2023


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3332 as of Sep 11 2024, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (15 GB total memory, 2 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software