. . . . . . . . . . . . . . . "%META:TOPICPARENT{name=\"VOSIndex\"}%\n---+ Visualizing Your Data With HtmlPivotViewer\nThe HtmlPivotViewer jQuery control is a great way to explore datasets \nin a web browser. The Virtuoso HtmlPivotViewer application extends this control to \nadd a sparql query editor, sharing with social media and Google translation. This guide shows you \nhow to install and configure the Virtuoso HtmlPivotViewer application to view \nexisting data sets and how to configure Virtuoso so that you can generate collections from your \nown data.\n\n * [[#ViewColl][Part 1. Viewing Collections]]\n * [[#GenColl][Part 2. Generating your own Collections]]\n * [[#GenPivotViewer][2.1 Using HtmlPivotViewer]]\n * [[#GenSPARQL][2.2 Using SPARQL]]\n * [[#GenFCT][2.3 Using The Facet Browser]]\n * [[#GeniSPARQL][2.4 Using iSPARQL]]\n * [[#SeeAlso][Related]]\n\n#ViewColl\n---++ Part 1. Viewing Collections\n\n---+++ Prerequisites\n\n * A Virtuoso Server with the following VAD packages installed:\n * The [[http://s3.amazonaws.com/opldownload/uda/vad-packages/6.2/virtuoso/c_uri_dav.vad][C_uri VAD]]\n(c_uri_dav.vad). This package contains a URL shortener that the \nHtmlPivotViewer application relies on to shorten the very long URIs that can result from \ngenerating a collection from a query.\n * The HtmlPivotViewer VAD. This VAD is included in the HtmlPivotViewer project that can be downloaded as \neither a [[http://opldownload.s3.amazonaws.com/HTML5/PivotViewer/html5pivotviewer-1.0.zip][zip file]] or [[http://opldownload.s3.amazonaws.com/HTML5/PivotViewer/html5pivotviewer-1.0.tar.gz][compressed tar archive]]. The VAD package contains the HtmlPivotViewer application.\n\nOnce these VAD packages are installed, viewing an existing collection is as simple as pointing your \nbrowser to the HtmlPivotViewer application on your server, i.e. -- \n\nhttp://your server address:your server port/HtmlPivotViewer\n\n-- and typing the collection address in the box on the page.\n%BR%%BR%%BR%%BR%\n\nAlternatively, you can specify the address of the collection as a parameter to the URL, e.g. --\n\nhttp://your server address:your server port/HtmlPivotViewer?url=http%3A%2F%2Ftweetpivot.com%2Fcollections%2Ffriends_kidehen.cxml\n\nNote: The collection address must be URL Encoded if given as part of the URL.\n\nYou can now start exploring existing pivot collections.\n\n#GenColl\n---++Part 2. Generating your own Collections\n\nOnce you have the HtmlPivotViewer installed, you will want to start generating pivot \ncollections from your own data. There are a number of ways ways you can do this. \n\nOne method is to generate a collection from the results of a SPARQL query. The HtmlPivotViewer \nincludes its own SPARQL query editor, or you can use the SPARQL endpoint on any Virtuoso server. \n\nAlternatively, you can generate a collection from a result set created in the facet browser. \n\nYou will need to install some additional packages, whichever method you use.\n\n---+++Prerequisites\n\n * The [[http://s3.amazonaws.com/opldownload/uda/vad-packages/6.2/virtuoso/sparql_cxml_dav.vad][SPARQL-CXML VAD]]\n(sparql_cxml_dav.vad). This package supports generating a collection from a SPARQL \nendpoint, and it is also required to use the SPARQL editor in the Virtuoso HtmlPivotViewer. \nIt also installs some example data that will be used in the rest of this guide.\n * The Virtuoso ImageMagick and QR Code plugins needs to be enabled. In your \nvirtuoso.ini, in the [Plugins] section, make sure you have lines for \n\"plain, im\" and \"plain, qrcode\", like this --\n\n[Plugins]\nLoadPath=../hosting\n...\nLoad6=plain, im\nLoad7=plain, qrcode\n \nRemember to restart Virtuoso if you make any changes to your virtuoso.ini.\n\nNote: The SPARQL-CXML package extends the SPARQL endpoint on the Virtuoso server where \nthe package is installed. This extension is required to be able to generate a pivot collection from the \nquery results. It is however possible to generate a pivot collection from a query against a third-party \nSPARQL endpoint or from a Virtuoso SPARQL endpoint that does not have the package installed, by using \na SPARQL-FED query from the Virtuoso instance that does have the SPARQL-CXML package \ninstalled.\n\n#GenPivotViewer\n---+++2.1 Generating a Collection from a SPARQL Query In HtmlPivotViewer\n\nThe HtmlPivotViewer application contains its own SPARQL editor. In this example, you will \nsee how to generate a collection from a simple DESCRIBE query; and also how to generate a collection \nfrom a SPARQL SELECT query, and then modify the query to meet your specific requirements.\n\n---++++2.1.1 Generating the Collection - Using a SPARQL DESCRIBE\n\nPoint your browser at the HtmlPivotViewer application on your server, i.e. --\n\nhttp://your server address:your server port/HtmlPivotViewer\n\n-- and then select the Edit link in the top-right-corner. You can type your query \ndirectly into the Query Text box in the form. The simplest way to get an overview \nof the data in a particular graph is to use a SPARQL DESCRIBE query. For example:\n\nDESCRIBE ?s \n FROM \n WHERE {?s ?p ?o}\n\ncreates a collection where each item is a ski resort with various facets giving further information \nabout each resort. \n%BR%%BR%%BR%%BR%\n\nClick on the View button at the foot of the page to view the collection \nin HtmlPivotViewer.\n%BR%%BR%%BR%%BR%\n\nNote: If at this point you see the HtmlPivotViewer but it is completely \nempty, then it is likely that the SPARQL-CXML VAD has not been correctly installed. However, if you \nsee the HtmlPivotViewer with the filter pane correctly loaded but no item images showing \nand if the position of the images can be highlighted, then it is likely that you have not enabled \nthe ImageMagick plugin for Virtuoso. \n\n---++++2.1.2 Generating the Collection - Using a SPARQL SELECT\n\nIf you want more control over the way the collection is generated from your data you can use \na SELECT query. This simple SELECT query will return all of the items \nin the http://pivot_test_data/ski_resorts graph, part of the example dataset. \nIn the following sections you will see how this simple query can be modified to change the way \nthat collection is generated.\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n\nExecute the query and display the results in HtmlPivotViewer by clicking the \nView button at the foot of the edit form.\n%BR%%BR%%BR%%BR%\n\nYou should see the collection like this:\n%BR%%BR%%BR%%BR%\n\nIf you want to save or share the query, you can do so using the permalink at the \ntop-right-corner of the page. If you need to fine tune your query, you can return to the editor \nby clicking on the Edit link. For example, the query that we used to generated \nthis first collection gives us all the items in the ski resorts graph. We can easily change it \nto get the items in the campsite graph by changing the from clause in the query:\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n%BR%%BR%%BR%%BR%\n\nThen click on View to see the new collection.\n%BR%%BR%%BR%%BR%\n\nAlternatively, we can see both campsites and ski resorts using the following query:\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o\n }\n UNION\n { ?s a camp:Campsite .\n ?s ?p ?o\n } \n }\n\n%BR%%BR% %BR%%BR%\n%BR%%BR% %BR%%BR%\n\n---++++2.1.3 Item Images\n\nIn the examples so far, all items are represented by the same icon. It would be helpful if different \nitems had different images. We have reserved some special variables in the SPARQL query to help \ncontrol collection generation, and one of those variables is ?image. \nIf we can find an image of the item in the collection and call it ?image, then when \nthe collection is generated that item will be represented by its image. So, for example, we can use \nthe following query to find images of some of the ski resorts in the example dataset --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION\n { ?s a camp:Campsite . \n ?s ?p ?o . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n%BR%%BR%%BR%%BR%\n\nIt would also be helpful to distinguish between the different types of items; in this case, the ski \nresorts (without images) and the campsites. Even if an item does not have its own image, we can \nchange the default image depending on the type of the item. To do this we use another reserved \nvariable, ?itemtype. Our example query then becomes --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o ; \n a ?itemtype . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION\n { ?s a camp:Campsite .\n ?s ?p ?o ;\n a ?itemtype . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n-- and we can clearly see which items are campsites.\n%BR%%BR%%BR%%BR%\n\n---++++2.1. Item Names\n\nIf one of the campsite or ski resort items is selected in HtmlPivotViewer, the info box \nopens on the right hand side of the page. It is headed with the name of the item, but in our example \nthat name is in fact a URI for the item. \n%BR%%BR%%BR%%BR%\n\nIn our example, just the name of the item would be sufficient, and it would be more readable. In the \ncase of the campsites, we can use the rdfs:label as the name, while in the case of the ski \nresorts, we need to use the ski:resort_name. The pattern is optional in case some of the \nitems do not have the necessary attribute defined --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o ;\n a ?itemtype . \n OPTIONAL { ?s ski:resort_name ?name } . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION \n { ?s a camp:Campsite . \n ?s ?p ?o ; \n a ?itemtype . \n OPTIONAL { ?s rdfs:label ?name } . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n%BR%%BR%%BR%%BR%\n\n---++++2.1.5 Facets\n\nThe collection we are have generated has two facets, called virtcxml:FacetP \nand virtcxml:FacetO, that map to the predicate (?p) and object \n(?o) as returned by the simple, generic ?s ?p ?o pattern that we have in the \nWHERE clause of the SPARQL SELECT that we are using. We can control which facets \nthe items in the collection have by having a separate pattern for each facet that we are interested in, and \nby giving them meaningful names. Some facets will be available on all items, while some will only be relevant \nto one type of item. For example, all items in our collection have a country code, but only the ski resorts \nhave altitude facets.\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s a ?itemtype ; \n geonames:countryCode ?country ;\n ski:resort_name ?name ;\n ski:beginner_slopes ?beginner_slopes ;\n ski:intermediate_slopes ?intermediate_slopes ;\n ski:advanced_slopes ?advanced_slopes ;\n ski:expert_slopes ?expert_slopes ;\n ski:altitude_m ?altitude .\n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION \n { ?s a camp:Campsite . \n ?s a ?itemtype ; \n geonames:countryCode ?country ; \n rdfs:label ?name ;\n campsite:resort_type ?resort_type ;\n campsite:resort ?resort ;\n campsite:region ?region ;\n campsite:category ?category . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n }\n\n%BR%%BR%%BR%%BR%\n\n#GenSPARQL\n---+++2.2 Generating a Collection from a SPARQL Endpoint\n\nThe SPARQL-CXML VAD package extends the Virtuoso SPARQL endpoint to add \"CXML collection\" as an \nalternative output format for query results. This example uses the same basic query that was used \nin the previous section, but executes it in the Virtuoso SPARQL endpoint.\n\n---++++2.2.1 Generating the Collection\n\nThe first step in generating the collection is the SPARQL query that returns the results that you \nare interested in. Point your browser at the Virtuoso SPARQL endpoint. It will be here:\n\nhttp://your server address:your server port/sparql\n\n\nThe following query will return all items in the http://pivot_test_data/ski_resorts \ngraph, part of the example dataset --\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n\nBy default, the results will be shown as a table in your browser. We need the results as a \nHtmlPivotViewer collection. Alternate result formats can be selected in a drop-down \nbox below the query form. Choose CXML (Pivot collection) --\n%BR%%BR% %BR%%BR%\n\nRun the query and, depending on your browser, the result set may now be displayed as XML. If you are \nusing Safari, you will just see a blank page, but if you view the source of the page you will see the XML. \nTo use this collection in HtmlPivotViewer, you simply copy the contents of the browser's \naddress bar, and use that as the collection address in HtmlPivotViewer. So, open \nHtmlPivotViewer, paste the address from the SPARQL query results in the collection \nURL box, and click submit. \n%BR%%BR%%BR%%BR%\n\nYou should see the collection like this:\n%BR%%BR%%BR%%BR%\n\nOnce you have opened the collection in HtmlPivotViewer, any additional editing of the query \ncan be done using the HtmlPivotViewer editor by simply clicking on the Edit \nlink at the top right hand corner.\n\nTip: If a query in the HtmlPivotViewer editor is failing, pasting it \ninto the Virtuoso SPARQL endpoint and attempting to run it there may reveal some additional error \ninformation which may help you resolve the problem.\n\n#GenFCT\n---+++2.3 Generating a Collection Using The Facet Browser\n\nUsing the Facet browser to create collections requires some extra packages. Once these packages are \ninstalled, generating the collection is very straightforward. You use the Facet browser to create \na result set; then click on the Make Pivot Collection link.\n\n---++++Prerequisites\n\n * The [[http://opldownload.s3.amazonaws.com/uda/vad-packages/6.2/virtuoso/rdf_mappers_dav.vad][Cartridges VAD]] \n(cartridges_dav.vad). This package provides base RDF functionality and the Sponger \nframework for converting non-RDF data to RDF.\n * The [[http://s3.amazonaws.com/opldownload/uda/vad-packages/6.2/virtuoso/fct_dav.vad][Virtuoso Facets web service]] \n(fct_dav.vad) A general purpose RDF query facility for facet based browsing.\n * The [[http://opldownload.s3.amazonaws.com/uda/vad-packages/6.2/virtuoso/fct_pivot_bridge_dav.vad][Facet Pivot Bridge]] \n(fct_pivot_bridge.vad). This package extends the Facets web service so a collection can \nbe generated from the faceted query result sets.\n\n---++++2.3.1 Generating the Collection\n\nThe Facet browser service will be found at \n\nhttp://your server address:your server port/fct\n\n%BR%%BR%%BR%%BR%\n\nType the word \"resort\" in the search box. This should find both the campsites and the ski resorts. The result set can be manipulated to only include the items that you are interested in. For example, \nby selecting Types in the Entity Relations Navigation pane, you can \nlimit the result set to just items of the type ski:SkiResort. \n%BR%%BR%%BR%%BR%\n\nOnce you have the result set that you want, click on the Make Pivot Collection link \nat the top of the page. This creates the collection, and opens it in HtmlPivotViewer. \n%BR%%BR%%BR%%BR%\n\n#GeniSPARQL\n---+++2.4 Generating a Collection from iSPARQL\n\nTo generate a collection from the iSPARQL interface, you will need to install an extra package.\n\n---++++Prerequisites\n\n * The [[http://s3.amazonaws.com/opldownload/uda/vad-packages/6.2/virtuoso/isparql_dav.vad][iSPARQL VAD]] \n(isparql_dav.vad). This package installs iSPARQL, a graphical utility for building \nand executing SPARQL queries.\n\n---++++2.4.1 Generating the Collection\n\nPoint your browser at the iSPARQL interface on your server. It can be found at \n\nhttp://your server address:your server port/isparql\n\n\nIt will open to a page like this:\n%BR%%BR%%BR%%BR%\n\nFrom the three tabs in the top center, choose the Advanced tab. This will open \na page where you can type in a query. Use the following DESCRIBE query:\n\nDESCRIBE ?s \n FROM \n WHERE {?s ?p ?o}\n\n%BR%%BR%%BR%%BR%\n\nClick on the arrow-in-a-blue-circle to run the query. The results page will be opened, showing \nthe ski resorts that have been found. \n%BR%%BR%%BR%%BR%\n\nTo make a pivot collection from these results, simply click on the Make Pivot link \nin the top left corner of the results pane. This will open the link in the HtmlPivotViewer.\n%BR%%BR%%BR%%BR%\n\n#SeeAlso\n---++ Related\n * [[VirtSparqlCxmlPivotViewer][Additional PivotViewer Guide]]\n * PivotViewer Demo Collections\n * [[http://www.delicious.com/kidehen/logd_demo][Linked Open Government-Oriented Demos]]\n * [[http://www.delicious.com/kidehen/pivot_collection_app][General PivotViewer + Linked Data Demos]]\n * [[http://www.delicious.com/kidehen/sparql_fed_demo][SPARQL-FED (Distributed or Federated SPARQL)-based Dynamic CXML and PivotViewer Demos]] \n * [[http://www.delicious.com/kidehen/qrcode_use_demo][Demos where the SPARQL-based CXML generation includes QR Code generation]]\n * [[http://www.delicious.com/kidehen/bbc_linkeddata][BBC-specific Demos]]\n * [[http://www.delicious.com/kidehen/meshup][Various Meshups]] (not \"Mashups,\" since these are driven by Linked Data, rather than by code)\n * [[http://www.delicious.com/kidehen/goodrelations][Linked Data-Driven eCommerce-Oriented PivotViewer Demos]]" . . . . . . . . . . . . . . . . . . "VirtVisualizeWithHtmlPivotViewer" . . . . . . . . . . . . . . "%META:TOPICPARENT{name=\"VOSIndex\"}%\n\n---+ Visualizing Your Data With HtmlPivotViewer\n\nThe HtmlPivotViewer jQuery control is a great way to explore datasets \nin a web browser. The Virtuoso HtmlPivotViewer application extends this control to \nadd a sparql query editor, sharing with social media and Google translation. This guide shows you \nhow to install and configure the Virtuoso HtmlPivotViewer application to view \nexisting data sets and how to configure Virtuoso so that you can generate collections from your \nown data.\n\n * [[#ViewColl][Part 1. Viewing Collections]]\n * [[#GenColl][Part 2. Generating your own Collections]]\n * [[#GenPivotViewer][2.1 Using HtmlPivotViewer]]\n * [[#GenSPARQL][2.2 Using SPARQL]]\n * [[#GenFCT][2.3 Using The Facet Browser]]\n * [[#GeniSPARQL][2.4 Using iSPARQL]]\n * [[#SeeAlso][Related]]\n\n#ViewColl\n---++ Part 1. Viewing Collections\n\n---+++ Prerequisites\n\n * A Virtuoso Server with the following VAD packages installed:\n * The [[https://virtuoso.openlinksw.com/download/][C_uri VAD]]\n(c_uri_dav.vad). This package contains a URL shortener that the \nHtmlPivotViewer application relies on to shorten the very long URIs that can result from \ngenerating a collection from a query.\n * The HtmlPivotViewer VAD. This VAD is included in the HtmlPivotViewer project that can be downloaded as \neither a [[http://download3.openlinksw.com/index.html?prefix=HTML5/PivotViewer/html5pivotviewer-1.0.zip][zip file]] or [[http://download3.openlinksw.com/index.html?prefix=/HTML5/PivotViewer/html5pivotviewer-1.0.tar.gz][compressed tar archive]]. The VAD package contains the HtmlPivotViewer application.\n\nOnce these VAD packages are installed, viewing an existing collection is as simple as pointing your \nbrowser to the HtmlPivotViewer application on your server, i.e. -- \n\nhttp://your server address:your server port/HtmlPivotViewer\n\n-- and typing the collection address in the box on the page.\n%BR%%BR%%BR%%BR%\n\nAlternatively, you can specify the address of the collection as a parameter to the URL, e.g. --\n\nhttp://your server address:your server port/HtmlPivotViewer?url=http%3A%2F%2Ftweetpivot.com%2Fcollections%2Ffriends_kidehen.cxml\n\nNote: The collection address must be URL Encoded if given as part of the URL.\n\nYou can now start exploring existing pivot collections.\n\n#GenColl\n---++Part 2. Generating your own Collections\n\nOnce you have the HtmlPivotViewer installed, you will want to start generating pivot \ncollections from your own data. There are a number of ways ways you can do this. \n\nOne method is to generate a collection from the results of a SPARQL query. The HtmlPivotViewer \nincludes its own SPARQL query editor, or you can use the SPARQL endpoint on any Virtuoso server. \n\nAlternatively, you can generate a collection from a result set created in the facet browser. \n\nYou will need to install some additional packages, whichever method you use.\n\n---+++Prerequisites\n\n * The [[https://virtuoso.openlinksw.com/download/][SPARQL-CXML VAD]]\n(sparql_cxml_dav.vad). This package supports generating a collection from a SPARQL \nendpoint, and it is also required to use the SPARQL editor in the Virtuoso HtmlPivotViewer. \nIt also installs some example data that will be used in the rest of this guide.\n * The Virtuoso ImageMagick and QR Code plugins needs to be enabled. In your \nvirtuoso.ini, in the [Plugins] section, make sure you have lines for \n\"plain, im\" and \"plain, qrcode\", like this --\n\n[Plugins]\nLoadPath=../hosting\n...\nLoad6=plain, im\nLoad7=plain, qrcode\n \nRemember to restart Virtuoso if you make any changes to your virtuoso.ini.\n\nNote: The SPARQL-CXML package extends the SPARQL endpoint on the Virtuoso server where \nthe package is installed. This extension is required to be able to generate a pivot collection from the \nquery results. It is however possible to generate a pivot collection from a query against a third-party \nSPARQL endpoint or from a Virtuoso SPARQL endpoint that does not have the package installed, by using \na SPARQL-FED query from the Virtuoso instance that does have the SPARQL-CXML package \ninstalled.\n\n#GenPivotViewer\n---+++2.1 Generating a Collection from a SPARQL Query In HtmlPivotViewer\n\nThe HtmlPivotViewer application contains its own SPARQL editor. In this example, you will \nsee how to generate a collection from a simple DESCRIBE query; and also how to generate a collection \nfrom a SPARQL SELECT query, and then modify the query to meet your specific requirements.\n\n---++++2.1.1 Generating the Collection - Using a SPARQL DESCRIBE\n\nPoint your browser at the HtmlPivotViewer application on your server, i.e. --\n\nhttp://your server address:your server port/HtmlPivotViewer\n\n-- and then select the Edit link in the top-right-corner. You can type your query \ndirectly into the Query Text box in the form. The simplest way to get an overview \nof the data in a particular graph is to use a SPARQL DESCRIBE query. For example:\n\nDESCRIBE ?s \n FROM \n WHERE {?s ?p ?o}\n\ncreates a collection where each item is a ski resort with various facets giving further information \nabout each resort. \n%BR%%BR%%BR%%BR%\n\nClick on the View button at the foot of the page to view the collection \nin HtmlPivotViewer.\n%BR%%BR%%BR%%BR%\n\nNote: If at this point you see the HtmlPivotViewer but it is completely \nempty, then it is likely that the SPARQL-CXML VAD has not been correctly installed. However, if you \nsee the HtmlPivotViewer with the filter pane correctly loaded but no item images showing \nand if the position of the images can be highlighted, then it is likely that you have not enabled \nthe ImageMagick plugin for Virtuoso. \n\n---++++2.1.2 Generating the Collection - Using a SPARQL SELECT\n\nIf you want more control over the way the collection is generated from your data you can use \na SELECT query. This simple SELECT query will return all of the items \nin the http://pivot_test_data/ski_resorts graph, part of the example dataset. \nIn the following sections you will see how this simple query can be modified to change the way \nthat collection is generated.\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n\nExecute the query and display the results in HtmlPivotViewer by clicking the \nView button at the foot of the edit form.\n%BR%%BR%%BR%%BR%\n\nYou should see the collection like this:\n%BR%%BR%%BR%%BR%\n\nIf you want to save or share the query, you can do so using the permalink at the \ntop-right-corner of the page. If you need to fine tune your query, you can return to the editor \nby clicking on the Edit link. For example, the query that we used to generated \nthis first collection gives us all the items in the ski resorts graph. We can easily change it \nto get the items in the campsite graph by changing the from clause in the query:\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n%BR%%BR%%BR%%BR%\n\nThen click on View to see the new collection.\n%BR%%BR%%BR%%BR%\n\nAlternatively, we can see both campsites and ski resorts using the following query:\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o\n }\n UNION\n { ?s a camp:Campsite .\n ?s ?p ?o\n } \n }\n\n%BR%%BR% %BR%%BR%\n%BR%%BR% %BR%%BR%\n\n---++++2.1.3 Item Images\n\nIn the examples so far, all items are represented by the same icon. It would be helpful if different \nitems had different images. We have reserved some special variables in the SPARQL query to help \ncontrol collection generation, and one of those variables is ?image. \nIf we can find an image of the item in the collection and call it ?image, then when \nthe collection is generated that item will be represented by its image. So, for example, we can use \nthe following query to find images of some of the ski resorts in the example dataset --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION\n { ?s a camp:Campsite . \n ?s ?p ?o . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n%BR%%BR%%BR%%BR%\n\nIt would also be helpful to distinguish between the different types of items; in this case, the ski \nresorts (without images) and the campsites. Even if an item does not have its own image, we can \nchange the default image depending on the type of the item. To do this we use another reserved \nvariable, ?itemtype. Our example query then becomes --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o ; \n a ?itemtype . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION\n { ?s a camp:Campsite .\n ?s ?p ?o ;\n a ?itemtype . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n-- and we can clearly see which items are campsites.\n%BR%%BR%%BR%%BR%\n\n---++++2.1. Item Names\n\nIf one of the campsite or ski resort items is selected in HtmlPivotViewer, the info box \nopens on the right hand side of the page. It is headed with the name of the item, but in our example \nthat name is in fact a URI for the item. \n%BR%%BR%%BR%%BR%\n\nIn our example, just the name of the item would be sufficient, and it would be more readable. In the \ncase of the campsites, we can use the rdfs:label as the name, while in the case of the ski \nresorts, we need to use the ski:resort_name. The pattern is optional in case some of the \nitems do not have the necessary attribute defined --\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s ?p ?o ;\n a ?itemtype . \n OPTIONAL { ?s ski:resort_name ?name } . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION \n { ?s a camp:Campsite . \n ?s ?p ?o ; \n a ?itemtype . \n OPTIONAL { ?s rdfs:label ?name } . \n OPTIONAL { ?s foaf:depiction ?image } \n } \n }\n\n%BR%%BR%%BR%%BR%\n\n---++++2.1.5 Facets\n\nThe collection we are have generated has two facets, called virtcxml:FacetP \nand virtcxml:FacetO, that map to the predicate (?p) and object \n(?o) as returned by the simple, generic ?s ?p ?o pattern that we have in the \nWHERE clause of the SPARQL SELECT that we are using. We can control which facets \nthe items in the collection have by having a separate pattern for each facet that we are interested in, and \nby giving them meaningful names. Some facets will be available on all items, while some will only be relevant \nto one type of item. For example, all items in our collection have a country code, but only the ski resorts \nhave altitude facets.\n\nPREFIX ski: \nPREFIX camp: \n\nSELECT * \n WHERE\n {\n { ?s a ski:SkiResort . \n ?s a ?itemtype ; \n geonames:countryCode ?country ;\n ski:resort_name ?name ;\n ski:beginner_slopes ?beginner_slopes ;\n ski:intermediate_slopes ?intermediate_slopes ;\n ski:advanced_slopes ?advanced_slopes ;\n ski:expert_slopes ?expert_slopes ;\n ski:altitude_m ?altitude .\n OPTIONAL { ?s foaf:depiction ?image } \n }\n UNION \n { ?s a camp:Campsite . \n ?s a ?itemtype ; \n geonames:countryCode ?country ; \n rdfs:label ?name ;\n campsite:resort_type ?resort_type ;\n campsite:resort ?resort ;\n campsite:region ?region ;\n campsite:category ?category . \n OPTIONAL { ?s foaf:depiction ?image } \n }\n }\n\n%BR%%BR%%BR%%BR%\n\n#GenSPARQL\n---+++2.2 Generating a Collection from a SPARQL Endpoint\n\nThe SPARQL-CXML VAD package extends the Virtuoso SPARQL endpoint to add \"CXML collection\" as an \nalternative output format for query results. This example uses the same basic query that was used \nin the previous section, but executes it in the Virtuoso SPARQL endpoint.\n\n---++++2.2.1 Generating the Collection\n\nThe first step in generating the collection is the SPARQL query that returns the results that you \nare interested in. Point your browser at the Virtuoso SPARQL endpoint. It will be here:\n\nhttp://your server address:your server port/sparql\n\n\nThe following query will return all items in the http://pivot_test_data/ski_resorts \ngraph, part of the example dataset --\n\nSELECT * \n FROM \n WHERE {?s ?p ?o}\n\n\nBy default, the results will be shown as a table in your browser. We need the results as a \nHtmlPivotViewer collection. Alternate result formats can be selected in a drop-down \nbox below the query form. Choose CXML (Pivot collection) --\n%BR%%BR% %BR%%BR%\n\nRun the query and, depending on your browser, the result set may now be displayed as XML. If you are \nusing Safari, you will just see a blank page, but if you view the source of the page you will see the XML. \nTo use this collection in HtmlPivotViewer, you simply copy the contents of the browser's \naddress bar, and use that as the collection address in HtmlPivotViewer. So, open \nHtmlPivotViewer, paste the address from the SPARQL query results in the collection \nURL box, and click submit. \n%BR%%BR%%BR%%BR%\n\nYou should see the collection like this:\n%BR%%BR%%BR%%BR%\n\nOnce you have opened the collection in HtmlPivotViewer, any additional editing of the query \ncan be done using the HtmlPivotViewer editor by simply clicking on the Edit \nlink at the top right hand corner.\n\nTip: If a query in the HtmlPivotViewer editor is failing, pasting it \ninto the Virtuoso SPARQL endpoint and attempting to run it there may reveal some additional error \ninformation which may help you resolve the problem.\n\n#GenFCT\n---+++2.3 Generating a Collection Using The Facet Browser\n\nUsing the Facet browser to create collections requires some extra packages. Once these packages are \ninstalled, generating the collection is very straightforward. You use the Facet browser to create \na result set; then click on the Make Pivot Collection link.\n\n---++++Prerequisites\n\n * The [[https://virtuoso.openlinksw.com/download/][Cartridges VAD]] \n(cartridges_dav.vad). This package provides base RDF functionality and the Sponger \nframework for converting non-RDF data to RDF.\n * The [[https://virtuoso.openlinksw.com/download/][Virtuoso Facets web service]] \n(fct_dav.vad) A general purpose RDF query facility for facet based browsing.\n * The [[https://virtuoso.openlinksw.com/download/][Facet Pivot Bridge]] \n(fct_pivot_bridge.vad). This package extends the Facets web service so a collection can \nbe generated from the faceted query result sets.\n\n---++++2.3.1 Generating the Collection\n\nThe Facet browser service will be found at \n\nhttp://your server address:your server port/fct\n\n%BR%%BR%%BR%%BR%\n\nType the word \"resort\" in the search box. This should find both the campsites and the ski resorts. The result set can be manipulated to only include the items that you are interested in. For example, \nby selecting Types in the Entity Relations Navigation pane, you can \nlimit the result set to just items of the type ski:SkiResort. \n%BR%%BR%%BR%%BR%\n\nOnce you have the result set that you want, click on the Make Pivot Collection link \nat the top of the page. This creates the collection, and opens it in HtmlPivotViewer. \n%BR%%BR%%BR%%BR%\n\n#GeniSPARQL\n---+++2.4 Generating a Collection from iSPARQL\n\nTo generate a collection from the iSPARQL interface, you will need to install an extra package.\n\n---++++Prerequisites\n\n * The [[https://virtuoso.openlinksw.com/download/][iSPARQL VAD]] \n(isparql_dav.vad). This package installs iSPARQL, a graphical utility for building \nand executing SPARQL queries.\n\n---++++2.4.1 Generating the Collection\n\nPoint your browser at the iSPARQL interface on your server. It can be found at \n\nhttp://your server address:your server port/isparql\n\n\nIt will open to a page like this:\n%BR%%BR%%BR%%BR%\n\nFrom the three tabs in the top center, choose the Advanced tab. This will open \na page where you can type in a query. Use the following DESCRIBE query:\n\nDESCRIBE ?s \n FROM \n WHERE {?s ?p ?o}\n\n%BR%%BR%%BR%%BR%\n\nClick on the arrow-in-a-blue-circle to run the query. The results page will be opened, showing \nthe ski resorts that have been found. \n%BR%%BR%%BR%%BR%\n\nTo make a pivot collection from these results, simply click on the Make Pivot link \nin the top left corner of the results pane. This will open the link in the HtmlPivotViewer.\n%BR%%BR%%BR%%BR%\n\n#SeeAlso\n---++ Related\n * [[VirtSparqlCxmlPivotViewer][Additional PivotViewer Guide]]\n * PivotViewer Demo Collections\n * [[http://www.delicious.com/kidehen/logd_demo][Linked Open Government-Oriented Demos]]\n * [[http://www.delicious.com/kidehen/pivot_collection_app][General PivotViewer + Linked Data Demos]]\n * [[http://www.delicious.com/kidehen/sparql_fed_demo][SPARQL-FED (Distributed or Federated SPARQL)-based Dynamic CXML and PivotViewer Demos]] \n * [[http://www.delicious.com/kidehen/qrcode_use_demo][Demos where the SPARQL-based CXML generation includes QR Code generation]]\n * [[http://www.delicious.com/kidehen/bbc_linkeddata][BBC-specific Demos]]\n * [[http://www.delicious.com/kidehen/meshup][Various Meshups]] (not \"Mashups,\" since these are driven by Linked Data, rather than by code)\n * [[http://www.delicious.com/kidehen/goodrelations][Linked Data-Driven eCommerce-Oriented PivotViewer Demos]]\n" . . . . . . . . . . . "2018-04-05T17:40:01Z" . . "2017-06-13T06:20:25Z" . "2017-06-13T06:20:25.698114"^^ . "2017-06-29T07:33:35.505339"^^ . . . "VirtVisualizeWithHtmlPivotViewer" . . . . "2017-06-29T07:33:35Z" . . "2018-04-05T17:40:01.894693"^^ . . . . . . . . . . . . "VirtVisualizeWithHtmlPivotViewer" . . . "770c90809c120c553c978decd5eee671" . . .