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

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

PrefixNamespace IRI
n23http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/SilverlightApp.
dctermshttp://purl.org/dc/terms/
n19http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&displaylang=
atomhttp://atomowl.org/ontologies/atomrdf#
n13http://docs.openlinksw.com/virtuoso/rdfsparqlintegrationmiddleware.html#
n26http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/IriList.
n32http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/DemoApp.
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/
n28http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/EmployeeDoc.
n18http://virtuoso.openlinksw.com/download/
dchttp://purl.org/dc/elements/1.1/
n21http://vos.openlinksw.com/dataspace/dav#
n22http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/SparqlviewService.
n24http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/SparqlviewModel.
n10http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#
n25http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/HyperlinkList.
rdfshttp://www.w3.org/2000/01/rdf-schema#
n17http://rdfs.org/sioc/services#
siocthttp://rdfs.org/sioc/types#
n5http://vos.openlinksw.com/dataspace/person/dav#
n20http://vos.openlinksw.com/dataspace/owiki/wiki/
n30http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/DomainService.
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n7http://vos.openlinksw.com/dataspace/owiki#
xsdhhttp://www.w3.org/2001/XMLSchema#
n12http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/RIAServicesHowTo/sioc.
n31http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/EmployeeDesc.
n33http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&displaylang=
n29http://vos.openlinksw.com/wiki/main/VOS/RIAServicesHowTo/EntityModel.
siochttp://rdfs.org/sioc/ns#
n4http://vos.openlinksw.com/dataspace/person/owiki#
Subject Item
n5:this
foaf:made
n2:RIAServicesHowTo
Subject Item
n21:this
sioc:creator_of
n2:RIAServicesHowTo
Subject Item
n16:item
n17:services_of
n2:RIAServicesHowTo
Subject Item
n7:this
sioc:creator_of
n2:RIAServicesHowTo
Subject Item
n20:VOS
sioc:container_of
n2:RIAServicesHowTo
atom:entry
n2:RIAServicesHowTo
atom:contains
n2:RIAServicesHowTo
Subject Item
n2:VirtAdoNet35Provider
sioc:links_to
n2:RIAServicesHowTo
Subject Item
n2:RIAServicesHowTo
rdf:type
atom:Entry sioct:Comment
dcterms:created
2017-06-13T05:38:46.948997
dcterms:modified
2017-06-29T07:34:55.665730
rdfs:label
RIAServicesHowTo
foaf:maker
n4:this n5:this
dc:title
RIAServicesHowTo
opl:isDescribedUsing
n12:rdf
sioc:has_creator
n7:this n21:this
sioc:attachment
n22:png n23:png n24:png n25:png n26:png n28:png n29:png n30:png n31:png n32:png
sioc:content
%META:TOPICPARENT{name="VirtAdoNet35Provider"}% ---+ Simple .NET RIA Services Application using Virtuoso as the Data Server %TOC% ---++ Introduction .NET RIA Services is a new framework from Microsoft that simplifies the development of N-Tier web applications. A typical application will consist of a presentation layer, application logic and a data access layer. In the examples that follow, we will be using a combination of Silverlight 3.0 and .NET RIA Services for the presentation and application layers, while using Virtuoso as the data server via its native ADO.NET provider. The first example demonstrates how to display data from the Employee table in the Demo database using web page hosted grid control. The second example shows the navigational power behind hyperlinked data (de-referenceable HTTP scheme IRIs) exposed by Linked Data Views built stop Virtuoso's demonstration relational database schema (which is very similar to SQL Server's Northwind Database). ---++ Prerequisites 1. The example assumes that you have a local Virtuoso server with the Northwind demo database installed. If the demo database is not already installed then download the [[http://virtuoso.openlinksw.com/download/][demo database VAD package]] (demo_dav.vad) and install it. The VAD package will create a new database in Virtuoso called demo containing the familiar Northwind tables. It will also creates [[http://docs.openlinksw.com/virtuoso/rdfsparqlintegrationmiddleware.html#rdfviews][Linked Data Views]] of the Northwind tables. In the example we assume the database is accessible on a hostname of "demo.openlinksw.com" on the default port 80, where an actually live instance of the Virtuoso Demo database is hosted. Users would use the appropriate hostname and port number of their Virtuoso installation to create the sample application, and would be would be localhost:8890 for a default installation or whatever the [[http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#ini_URIQA][URIQA DefaultHost]] Virtuoso configuration parameter is set to when the demo database VAD package is installed. 1. The Virtuoso ADO.Net provider for .Net 3.5 and the Entity Framework 1. Microsoft Visual Studio 2008 1. The Virtuoso [[http://virtuoso.openlinksw.com/download/][Cartridges]] VAD package 1. [[http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&displaylang=en][Silverlight 3 Tools for Visual Studio 2008 SP1]] 1 [[http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&displaylang=en][Microsoft .NET RIA Services July 2009 Preview]] ---++ Creating the Application ---+++ Step 1 - Create the Visual Studio Projects 1. Open <b>Visual Studio</b> and create a new <b>Silverlight Application</b> project. Call the project <nowiki>DemoApplication</nowiki>. 1. In the New Silverlight Application dialog ensure that <b>Enable .NET RIA Services</b> is checked. Click the <b>OK</b> button. %BR%%BR%<img src="%ATTACHURLPATH%/SilverlightApp.png" style="wikiautogen"/>%BR%%BR% 1. At this point a skeleton solution is created that consists of a client project called <nowiki>DemoApplication</nowiki> and a server project called <nowiki>DemoApplication.Web</nowiki>. This application will use data from the Virtuoso database. We add the data and its schema to the application by adding an ADO.NET entity data model to the server project. ---+++Step 2 - Add the Data Model 1. Right click the server project in the <b>Solution Explorer</b> and <b>Add New Item</b>. In the dialog box select <b>ADO.NET Entity Data Model</b> and call it demo.edmx. Click the <b>Add</b> button. This will open the <b>Entity Data Model Wizard</b>. 1. Choose <b>Generate From Database</b> and click <b>Next</b>. 1. Set up a connection to the Demo database on your local Virtuoso Server, select <b>Yes, include the sensitive data in the connection string</b> and set the name of the entities to <nowiki>DemoEntities</nowiki>. Click <b>Next</b>. 1. On the <b>Choose Your Database Objects</b> page expand <b>Tables</b> and select Employees. Check that the Model Namespace is <nowiki>DemoModel</nowiki> and click <b>Finish</b>. %BR%%BR%<img src="%ATTACHURLPATH%/EntityModel.png" style="wikiautogen"/> %BR%%BR% 1. We want to make the entities in the model available to both the client and server parts of the solution. To do this we need to add a <nowiki>DomainService</nowiki> to the solution. However, to make the entities from the data model available to the domain service we must first build the solution. ---+++Step 3 - Add a Domain Service 1. First build the solution. 1. Right click the server project in the <b>Solution Explorer</b> and <b>Add New Item</b>. In the dialog box choose <b>Domain Service Class</b> from the Templates pane and call it <nowiki>EmployeeService.cs</nowiki>. Click <b>Add</b>. This will open the <b>Add New Domain Service Class</b> dialog. 1. The entities from the model we have just added to the project are listed under <b>Entities</b>. Tick the box next to Employees. and click OK. %BR%%BR%<img src="%ATTACHURLPATH%/DomainService.png" style="wikiautogen"/>%BR%%BR% 1. This will create the <nowiki>DomainService</nowiki> class and generated code in both the client and server parts of the application. The Silverlight client can now interact with the data through the <nowiki>DomainContext</nowiki> class in the client project. At this point you need to build the solution again. ---+++Step 4 - Display The Data 1. From the <b>Silverlight XAML Controls</b> in the <b>Toolbox</b> drag a <b><nowiki>DataGrid</nowiki></b> between the &lt;Grid&gt; &lt;/Grid&gt; tags on MainPage.xaml in the client. Call the grid <nowiki>EmployeeGrid</nowiki>. <verbatim> <data:DataGrid Name="EmployeeGrid"></data:DataGrid> </verbatim> 1. Instantiate the <nowiki>DomainContext</nowiki> to get the list of employees and add them to the grid by adding code to <nowiki>MainPage.xaml.cs</nowiki> so it looks like this: <verbatim> using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using DemoApplication.Web; using System.Windows.Ria.Data; namespace DemoApplication { public partial class MainPage : UserControl { private EmployeeContext _employeeContext = new EmployeeContext(); public MainPage() { InitializeComponent(); LoadOperation<Employees> LoadOp = this._employeeContext.Load(this._employeeContext.GetEmployeesQuery()); this.EmployeeGrid.ItemsSource = LoadOp.Entities; } } } </verbatim> 1. Build and run the application. Internet Explorer will be launched and you will see the data displayed on the page as a grid. %BR%%BR%<img src="%ATTACHURLPATH%/DemoApp.png" style="wikiautogen"/>%BR%%BR% ---++Displaying RDF Data One advantage of using Virtuoso as the data server is the seamless way in which we can use this use this application to expose dereferenceable HTTP IRIs which make the record level relationships explorable across many dimensions. Virtuoso's hybrid SPASQL (SPARQL inside SQL) query language enables RDF model data -- hosted within the Virtuoso Quad store -- to be queried using SPARQL from any of its SQL interfaces (ODBC, JDBC, ADO.NET, OLE-DB, XMLA); all you do is prefix your queries with the keyword SPARQL. In the example that follows we will use SPASQL to create a SQL view that exposes IRIs for records in the Employee table. ---+++Step 1 - Create the View in Virtuoso 1. Open the Virtuoso Conductor. 1. In iSQL, execute the following statement. Remember to use the appropriate hostname and port number of your Virtuoso installation, typically localhost:8890 for a default installation or whatever the [[http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#ini_URIQA][URIQA DefaultHost]] Virtuoso configuration parameter was set to when the demo database VAD package was installed. <verbatim> CREATE VIEW Demo.demo.sparqlview as SPARQL PREFIX nwind: <http://demo.openlinksw.com/schemas/northwind#> SELECT DISTINCT ?s FROM <http://demo.openlinksw.com/Northwind> WHERE {?s a nwind:Employee} </verbatim> ---+++Step 2 - Modify the Solution To use the View 1. Delete the existing Employee model and add a new one that comprises this new view. %BR%%BR%<img src="%ATTACHURLPATH%/SparqlviewModel.png" style="wikiautogen"/>%BR%%BR% 1. Delete the <nowiki>DomainService</nowiki>. Build the solution and add a new <nowiki>DomainService</nowiki> called <nowiki>EmployeeService</nowiki>. Select the sparqlview entity. Build the solution. %BR%%BR%<img src="%ATTACHURLPATH%/SparqlviewService.png" style="wikiautogen"/>%BR%%BR% 1. Modify the code in mainpage.xaml.cs so it uses the sparqview entity. It should look like this: <verbatim> using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using DemoApplication.Web; using System.Windows.Ria.Data; namespace DemoApplication { public partial class MainPage : UserControl { private EmployeeContext _employeeContext = new EmployeeContext(); public MainPage() { InitializeComponent(); LoadOperation<sparqlview> LoadOp = this._employeeContext.Load(this._employeeContext.GetSparqlviewQuery()); this.EmployeeGrid.ItemsSource = LoadOp.Entities; } } } </verbatim> 1. Build and run the application. You will see a list of IRIs that identify the Northwind employees. %BR%%BR%<img src="%ATTACHURLPATH%/IriList.png" style="wikiautogen"/>%BR%%BR% 1. To realize the power of linked data we would now liked to begin exploring this data by clicking on these IRIs. ---+++ Step 3 - Make Hyperlinks From IRIs 1. Modify the <nowiki>DataGrid</nowiki> in MainPage.xaml to bind the IRI in each cell of the grid to a Hyperlink button. 1. We set the <nowiki>AutoGenerateColumns</nowiki> property of the <nowiki>DataGrid</nowiki> to False then add our own Template for the column. MainPage.xaml should look like this: <verbatim> <UserControl xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" x:Class="DemoApplication.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <Grid x:Name="LayoutRoot"> <data:DataGrid Name="EmployeeGrid" AutoGenerateColumns="False"> <data:DataGrid.Columns> <data:DataGridTemplateColumn Header="Employee"> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel x:Name="DisplayEmployeeData" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="5" > <HyperlinkButton Content ="{Binding s}" NavigateUri="{Binding s}" Margin="5,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" FontSize="12"> </HyperlinkButton> </StackPanel> </DataTemplate> </data:DataGridTemplateColumn.CellTemplate> </data:DataGridTemplateColumn> </data:DataGrid.Columns> </data:DataGrid> </Grid> </UserControl> </verbatim> 1. If we build and run the project now each IRI in the list appears as a hyperlink. %BR%%BR%<img src="%ATTACHURLPATH%/HyperlinkList.png" style="wikiautogen"/>%BR%%BR% 1. Clicking on each of the links exposes new Employee relations where each Attribute and Value (optionally) pair also exist in link form. Each of these links creates a powerful linked data graph exposing data level relationships, all devoid of traditional join overhead associated with relational queries. %BR%%BR%<img src="%ATTACHURLPATH%/EmployeeDoc.png" style="wikiautogen"/>%BR%%BR% %BR%%BR%<img src="%ATTACHURLPATH%/EmployeeDesc.png" style="wikiautogen"/>%BR%%BR% ---++ Next Steps The examples in this document show you how to simply display data in a browser using Silverlight 3 and .NET RIA Services. See an [[RIAServicesHowTo2][example]] of a more complicated application.
sioc:id
0398aeaa7b88f998a0c148763cba5dcd
sioc:link
n2:RIAServicesHowTo
sioc:has_container
n20:VOS
n17:has_services
n16:item
atom:title
RIAServicesHowTo
sioc:links_to
n10:ini_URIQA n13:rdfviews n18: n19:en n33:en
atom:source
n20:VOS
atom:author
n5:this
atom:published
2017-06-13T05:38:46Z
atom:updated
2017-06-29T07:34:55Z
sioc:topic
n20:VOS
Subject Item
n2:RIAServicesHowTo2
sioc:links_to
n2:RIAServicesHowTo