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

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

PrefixNamespace IRI
n41http://docs.openlinksw.com/virtuoso/fn_http_get.
n21http://rdfs.org/sioc/
n15http://docs.openlinksw.com/virtuoso/fn_xpath_eval.
vihttp://www.openlinksw.com/virtuoso/xslt/
n32http://docs.openlinksw.com/virtuoso/fn_ttlp.
n39http://docs.openlinksw.com/virtuoso/fn_string_output.
n6http://rdfs.org/sioc/services#
n25http://docs.openlinksw.com/virtuoso/ASYNCEXECMULTITHREAD.
dchttp://purl.org/dc/elements/1.1/
n17http://www.w3.org/TR/rdf-syntax-grammar/
n43http://vos.openlinksw.com/dataspace/%28NULL%29/wiki/VOS/
n2http://vos.openlinksw.com/dataspace/owiki#
n11http://docs.openlinksw.com/virtuoso/fn_xslt.
n4http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/
n19http://www.pingthesemanticweb.com/
dctermshttp://purl.org/dc/terms/
n7http://vos.openlinksw.com/dataspace/services/wiki/
rdfshttp://www.w3.org/2000/01/rdf-schema#
bibohttp://purl.org/ontology/bibo/
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n20http://demo.openlinksw.com/doc/html/fn_dbg_obj_print.
atomhttp://atomowl.org/ontologies/atomrdf#
n12http://docs.openlinksw.com/virtuoso/fn_serialize_to_UTF8_xml.
n45http://www.w3.org/1999/02/
n31http://www.w3.org/2000/01/
n35http://vos.openlinksw.com/dataspace/dav#
xsdhhttp://www.w3.org/2001/XMLSchema#
siochttp://rdfs.org/sioc/ns#
n34http://vos.openlinksw.com/dataspace/owiki/wiki/VOS/VirtSpongerCartridgeProgrammersGuide_Part3/sioc.
n14http://vos.openlinksw.com/dataspace/person/owiki#
oplhttp://www.openlinksw.com/schema/attribution#
n18http://www.w3.org/TR/grddl-primer/
n36http://docs.openlinksw.com/virtuoso/fn_rdf_load_rdfxml.
n9http://vos.openlinksw.com/dataspace/person/dav#
n42http://docs.openlinksw.com/virtuoso/fn_http.
n29http://www.w3.org/2004/02/skos/
n37http://docs.openlinksw.com/virtuoso/fn_sprintf_inverse.
foafhttp://xmlns.com/foaf/0.1/
n38http://docs.openlinksw.com/virtuoso/fn_http_request_header.
n28http://docs.openlinksw.com/virtuoso/fn_split_and_decode.
n22http://www.w3.org/TR/2004/REC-rdf-primer-20040210/
siocthttp://rdfs.org/sioc/types#
n26http://vos.openlinksw.com/dataspace/owiki/wiki/
n40http://docs.openlinksw.com/virtuoso/fn_string_output_string.
n23http://www.openlinksw.com/schemas/
n13http://docs.openlinksw.com/virtuoso/fn_xtree_doc.
Subject Item
n9:this
foaf:made
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n35:this
sioc:creator_of
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n7:item
n6:services_of
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n2:this
sioc:creator_of
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n26:VOS
sioc:container_of
n4:VirtSpongerCartridgeProgrammersGuide_Part3
atom:entry
n4:VirtSpongerCartridgeProgrammersGuide_Part3
atom:contains
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n4:VirtuosoSpongerCartridgeProgrammersGuide_Part2
sioc:links_to
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n4:VOSIndex
sioc:links_to
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n4:VirtSpongerRESTPatterns
sioc:links_to
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n4:VirtSpongerNanotation
sioc:links_to
n4:VirtSpongerCartridgeProgrammersGuide_Part3
Subject Item
n4:VirtSpongerCartridgeProgrammersGuide_Part3
rdf:type
sioct:Comment atom:Entry
dcterms:created
2017-06-13T05:45:09.792028
dcterms:modified
2017-06-29T07:41:07.460553
rdfs:label
VirtSpongerCartridgeProgrammersGuide_Part3
foaf:maker
n9:this n14:this
dc:title
VirtSpongerCartridgeProgrammersGuide_Part3
opl:isDescribedUsing
n34:rdf
sioc:has_creator
n2:this n35:this
sioc:content
---+Virtuoso Programmer's Guide - RDF Middleware ("Sponger") (Part 3) * [[VirtSpongerCartridgeProgrammersGuide][Part 1]] * [[VirtuosoSpongerCartridgeProgrammersGuide_Part2][Part 2]] ---+++Contents (Part 3) * Sponger Queue API * Functions * REST Web service * Useful Virtuoso Functions * String Functions * <nowiki>sprintf_inverse</nowiki> * <nowiki>split_and_decode</nowiki> * Retrieving URLs * <nowiki>http_get</nowiki> * <nowiki>http_request_header</nowiki> * Handling Non-XML Response Content * <nowiki>json_parse</nowiki> * Writing Arbitrarily Long Text * http * <nowiki>string_output</nowiki> * <nowiki>string_output_string</nowiki> * XML & XSLT * <nowiki>xtree_doc</nowiki> * <nowiki>xpath_eval</nowiki> * <nowiki>DB.DBA.RDF_MAPPER_XSLT</nowiki> * Character Set Conversion * <nowiki>serialize_to_UTF8_xml</nowiki> * Loading Data Into the Quad Store * <nowiki>DB.DBA.RDF_LOAD_RDFXML</nowiki> * DB.DBA.TTLP * Debug Output * <nowiki>dbg_obj_print</nowiki> * References * Appendix A: PingTheSemanticWeb RDF Notification Service * Appendix B: Main Namespaces used by OpenLink Cartridges * Appendix C: Freebase Cartridge & Stylesheet ---++Sponger Queue API ---+++Functions * <nowiki>DB.DBA.RDF_SPONGER_QUEUE_ADD</nowiki>: This function is available when the cartridges vad is installed. <verbatim> DB.DBA.RDF_SPONGER_QUEUE_ADD (url, options); </verbatim> * <b>url</b>: the Network Resource URI to be fetched; * <b>options</b>: an array usually typical sponger pragmas, for ex: <verbatim> vector ('get:soft', 'soft', 'refresh_free_text', 1); </verbatim> ---+++REST Web service The Sponger REST Web service has the following characteristics: * <b>endpoint</b>: <code><nowiki>http://cname/about/service</nowiki></code> * <b>parameters</b>: 1 <code>op=add</code>: type of operation, for now addition to the queue is supported 1 <code>uris=[json array]:</code> an array of URIs to be added to the sponger queue, the format is JSON array, for example: <verbatim> { "uris":["http://www.amazon.co.uk/Hama-Stylus-Input-Apple-iPad/dp/B003O0OM0C", "http://www.amazon.co.uk/Krusell-GAIA-Case-Apple-iPad/dp/B003QHXWWC" ] } </verbatim> The service will return a json encoded result of the number of items added, for example: <verbatim> { "result":2 } </verbatim> In case of error a JSON with error text will be returned and http status 500. ---++++cURL example 1 Assume file.txt which contains URL encoded JSON string: <verbatim> uris=%7B%20%22uris%22%3A%5B%22http%3A%2F%2Fwww.amazon.co.uk%2FHama-Stylus-Input-Apple-iPad%2Fdp%2FB003O0OM0C%22%2C%20%22http%3A%2F%2Fwww.amazon.co.uk%2FKrusell-GAIA-Case-Apple-iPad%2Fdp%2FB003QHXWWC%22%20%5D%20%7D </verbatim> 1 Execute the following command: <verbatim> curl -i -d@file.txt http://cname/about/service?op=add HTTP/1.1 200 OK Server: Virtuoso/06.02.3129 (Darwin) i686-apple-darwin10.0.0 VDB Connection: Keep-Alive Date: Thu, 05 May 2011 12:06:24 GMT Accept-Ranges: bytes Content-Type: applcation/json; charset="UTF-8" Content-Length: 14 { "result":2 } </verbatim> ---++Useful Virtuoso Functions ---+++String Functions ---++++<nowiki>sprintf_inverse</nowiki> <nowiki>sprintf_inverse</nowiki> takes a string to parse and a format string. If the first argument matches the format string then it returns vector of the values matching the placeholders in the format string. <nowiki>sprintf_inverse</nowiki> comes in useful for extracting fields from URLs. Full description: [[http://docs.openlinksw.com/virtuoso/fn_sprintf_inverse.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> tmp := sprintf_inverse (new_origin_uri, 'http://farm%s.static.flickr.com/%s/%s_%s.%s', 0); img_id := tmp[2]; </verbatim> ---++++<nowiki>split_and_decode</nowiki> Converts escaped key=value pairs in an input string into a vector of strings. Full description: [[http://docs.openlinksw.com/virtuoso/fn_split_and_decode.html][Virtuoso Functions Guide entry]] ---+++++Example To split the HTTP request and response headers passed to the cartridge hook function. <verbatim> request_hdr := headers[0]; response_hdr := headers[1]; host := http_request_header (request, 'Host'); tmp := split_and_decode (request_hdr[0], 0, '\0\0 '); http_method := tmp[0]; url := tmp[1]; protocol_version := substring (tmp[2], 6, 8); tmp := rtrim (response_hdr[0], '\r\n'); tmp := split_and_decode (response_hdr[0], 0, '\0\0 '); </verbatim> ---+++Retrieving URLs ---++++<nowiki>http_get</nowiki> Returns a string containing the body of the requested URL and optionally the request headers. Full description: [[http://docs.openlinksw.com/virtuoso/fn_http_get.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> url := sprintf('http://api.flickr.com/services/rest/?? method=flickr.photos.getInfo&photo_id=%s&api_key=%s', img_id, api_key); tmp := http_get (url, hdr); if (hdr[0] not like 'HTTP/1._ 200 %') signal ('22023', trim(hdr[0], '\r\n'), 'RDFXX'); xd := xtree_doc (tmp); </verbatim> ---++++<nowiki>DB.DBA.RDF_HTTP_URL_GET</nowiki> A wrapper around http_get. Retrieves a URL using the specified HTTP method (defaults to GET). The function can handle proxies, redirects (up to fifteen) and HTTPS. ---+++++Example <verbatim> uri := sprintf ('http://musicbrainz.org/ws/1/%s/%s?type=xml&inc=%U', kind, id, inc); cnt := RDF_HTTP_URL_GET (uri, '', hdr, 'GET', 'Accept: */*'); xt := xtree_doc (cnt); xd := DB.DBA.RDF_MAPPER_XSLT (registry_get ('_cartridges_path_') || 'xslt/main/mbz2rdf.xsl', xt, vector ('baseUri', new_origin_uri)); </verbatim> ---++++<nowiki>http_request_header</nowiki> Returns an array containing the HTTP request header lines. Full description: [[http://docs.openlinksw.com/virtuoso/fn_http_request_header.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> content := RDF_HTTP_URL_GET (rdf_url, new_origin_uri, hdr, 'GET', 'Accept: application/rdf+xml, text/rdf+n3, */*'); ret_content_type := http_request_header (hdr, 'Content-Type', null, null); </verbatim> ---+++Handling Non-XML Response Content ---++++<nowiki>json_parse</nowiki> Parses JSON content into a tree. ---+++++Example <verbatim> url := sprintf ('http://www.freebase.com/api/service/mqlread?queries=%U', qr); content := http_get (url, hdr); tree := json_parse (content); tree := get_keyword ('ROOT', tree); tree := get_keyword ('result', tree); </verbatim> ---+++Writing Arbitrarily Long Text ---++++http Writes to an http client or a string output stream. Full description: [[http://docs.openlinksw.com/virtuoso/fn_http.html][Virtuoso Functions Guide entry]] ---+++++Example Writing N3 to a string output stream using function http(), parsing the N3 into a graph, then loading the graph into the quad store. <verbatim> ses := string_output (); http ('@prefix opl: <http://www.openlinksw.com/schema/attribution#> .\n', ses); http ('@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n', ses); ... DB.DBA.TTLP (ses, base, graph); DB.DBA.RDF_LOAD_RDFXML (strg, base, graph); </verbatim> ---++++<nowiki>string_output</nowiki> Makes a string output stream, a special object that may be used to buffer arbitrarily long streams of data. The HTTP output functions optionally take a string output stream handle as a parameter and then output to the string stream instead of the HTTP client. Full description: [[http://docs.openlinksw.com/virtuoso/fn_string_output.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> ses := string_output (); cnt := http_get (sprintf ('http://download.finance.yahoo.com/d/quotes.csv?s=%U&f=nsbavophg&e=.csv', symbol)); arr := rdfm_yq_parse_csv (cnt); http ('<quote stock="NASDAQ">', ses); foreach (any q in arr) do { http_value (q[0], 'company', ses); http_value (q[1], 'symbol', ses); ... } http ('</quote>', ses); content := string_output_string (ses); xt := xtree_doc (content); </verbatim> ---++++<nowiki>string_output_string</nowiki> Produces a string out of a string output stream. Full description: [[http://docs.openlinksw.com/virtuoso/fn_string_output_string.html][Virtuoso Functions Guide entry]] ---+++++Example See string_output above. ---+++XML & XSLT ---++++<nowiki>xtree_doc</nowiki> Parses the input string, which is expected to be a well formed XML fragment and returns a parse tree as a special memory-resident object. Full description: [[http://docs.openlinksw.com/virtuoso/fn_xtree_doc.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> content := RDF_HTTP_URL_GET (uri, '', hdr, 'GET', 'Accept: */*'); xt := xtree_doc (content); </verbatim> ---++++<nowiki>xpath_eval</nowiki> Applies an XPATH expression to a context node and returns the result(s). Full description: [[http://docs.openlinksw.com/virtuoso/fn_xpath_eval.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> profile := cast (xpath_eval ('/html/head/@profile', xt) as varchar); </verbatim> ---++++<nowiki>DB.DBA.RDF_MAPPER_XSLT</nowiki> A simple wrapper around the Virtuoso function xslt which sets the current user to dba before returning an XML document transformed by an XSLT stylesheet. Full description: [[http://docs.openlinksw.com/virtuoso/fn_xslt.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> tmp := http_get (url); xd := xtree_doc (tmp); xt := DB.DBA.RDF_MAPPER_XSLT ( registry_get ('_cartridges_path_') || 'xslt/main/atom2rdf.xsl', xd, vector ('baseUri', coalesce (dest, graph_iri))); </verbatim> ---+++Character Set Conversion ---++++<nowiki>serialize_to_UTF8_xml</nowiki> Converts a value of arbitrary type to a UTF-8 string representation. Full description: [[http://docs.openlinksw.com/virtuoso/fn_serialize_to_UTF8_xml.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> xt := DB.DBA.RDF_MAPPER_XSLT ( registry_get ('_cartridges_path_') || 'xslt/main/crunchbase2rdf.xsl', xt, vector ('baseUri', coalesce (dest, graph_iri), 'base', base, 'suffix', suffix)); xd := serialize_to_UTF8_xml (xt); DB.DBA.RM_RDF_LOAD_RDFXML (xd, new_origin_uri, coalesce (dest, graph_iri)); </verbatim> ---+++Loading Data Into the Quad Store ---++++<nowiki>DB.DBA.RDF_LOAD_RDFXML</nowiki> Parses the content of RDF/XML text into a sequence of separate triples and loads the triples into the specified graph in the Virtuoso Quad Store. Full description: [[http://docs.openlinksw.com/virtuoso/fn_rdf_load_rdfxml.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> content := RDF_HTTP_URL_GET (uri, '', hdr, 'GET', 'Accept: */*'); xt := xtree_doc (content); xd := DB.DBA.RDF_MAPPER_XSLT ( registry_get ('_cartridges_path_') || 'xslt/main/mbz2rdf.xsl', xt, vector ('baseUri', new_origin_uri)); xd := serialize_to_UTF8_xml (xd); DB.DBA.RM_RDF_LOAD_RDFXML (xd, new_origin_uri, coalesce (dest, graph_iri)); </verbatim> ---++++DB.DBA.TTLP Parses the content of TTL (TURTLE or N3) text and loads the triples into the specified graph in the Virtuoso Quad Store. Full description: [[http://docs.openlinksw.com/virtuoso/fn_ttlp.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> sess := string_output (); ... http (sprintf ('<http://dbpedia.org/resource/%s> <http://xbrlontology.com/ontology/finance/stock_market#hasCompetitor> <http://dbpedia.org/resource/%s> .\n', symbol, x), sess); http (sprintf ('<http://dbpedia.org/resource/%s> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://finance.yahoo.com/q?s=%s> .\n', x, x), sess); content := string_output_string (sess); DB.DBA.TTLP (content, new_origin_uri, coalesce (dest, graph_iri)); </verbatim> ---+++Debug Output ---++++<nowiki>dbg_obj_print</nowiki> Prints to the Virtuoso system console. Full description: [[http://demo.openlinksw.com/doc/html/fn_dbg_obj_print.html][Virtuoso Functions Guide entry]] ---+++++Example <verbatim> dbg_obj_print ('try all grddl mappings here'); </verbatim> ---+References * RDF Primer: http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ * RDF/XML Syntax Specification: http://www.w3.org/TR/rdf-syntax-grammar/ * GRDDL Primer: http://www.w3.org/TR/grddl-primer/ ---+Appendix A: PingTheSemanticWeb RDF Notification Service [[http://www.pingthesemanticweb.com/][PingtheSemanticWeb]] (PTSW) is a repository for RDF documents. The PTSW web service archives the location of recently created or updated RDF documents on the Web. It is intended for use by crawlers or other types of software agents which need to know when and where the latest updated RDF documents can be found. They can request a list of recently updated documents as a starting location to crawl the Semantic Web. You may find this service useful for publicizing your own RDF content. Content authors can notify PTSW that an RDF document has been created or updated by pinging the service with the URL of the document. The Sponger supports this facility through the <nowiki>async_queue</nowiki> and <nowiki>ping_service</nowiki> parameters of the cartridge hook function, where the <nowiki>ping_service</nowiki> parameter contains the ping service URL as configured in the SPARQL section of the virtuoso.ini file: <verbatim> [SPARQL] ... PingService = http://rpc.pingthesemanticweb.com/ ... </verbatim> The configured ping service can be called using an asynchronous request and the <nowiki>RDF_SW_PING</nowiki> procedure as illustrated below. <verbatim> create procedure DB.DBA.RDF_LOAD_HTML_RESPONSE ( in graph_iri varchar, in new_origin_uri varchar, in dest varchar, inout ret_body any, inout async_queue any, inout ping_service any, inout _key any, inout opts any ) { ... if ( ... and async_queue is not null) aq_request (async_queue, 'DB.DBA.RDF_SW_PING', vector (ping_service, new_origin_uri)); </verbatim> For more details, please refer to the section [[http://docs.openlinksw.com/virtuoso/ASYNCEXECMULTITHREAD.html][Asynchronous Execution and Multithreading in Virtuoso/PL]] in the Virtuoso reference documentation. ---+Appendix B: Main Namespaces used by OpenLink Cartridges A list of the main namespaces / ontologies used by OpenLink-provided Sponger cartridges is given below. Some of these ontologies may prove useful when creating your own cartridges. * - http://www.openlinksw.com/virtuoso/xslt/ * - http://www.openlinksw.com/schemas/XHTML# * rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# * rdfs: http://www.w3.org/2000/01/rdf-schema# * dc: http://purl.org/dc/elements/1.1/ * dcterms: http://purl.org/dc/terms/ * foaf: http://xmlns.com/foaf/0.1/ * sioc: http://rdfs.org/sioc/ns# * sioct: http://rdfs.org/sioc/types# * skos: http://www.w3.org/2004/02/skos/core# * bibo: http://purl.org/ontology/bibo/ ---+Appendix C: Freebase Cartridge & Stylesheet Snapshots of the Freebase cartridge and stylesheet compatible with the meta-cartridge example presented earlier in this document can be found below. ---+++<nowiki>DB.DBA.RDF_LOAD_MQL</nowiki>: <verbatim> --no_c_escapes- create procedure DB.DBA.RDF_LOAD_MQL (in graph_iri varchar, in new_origin_uri varchar, in dest varchar, inout _ret_body any, inout aq any, inout ps any, inout _key any, inout opts any) { declare qr, path, hdr any; declare tree, xt, xd, types any; declare k, cnt, url, sa varchar; hdr := null; sa := ''; declare exit handler for sqlstate '*' { --dbg_printf ('%s', __SQL_MESSAGE); return 0; }; path := split_and_decode (new_origin_uri, 0, '%\0/'); if (length (path) < 1) return 0; k := path [length(path) - 1]; if (path [length(path) - 2] = 'guid') k := sprintf ('"id":"/guid/%s"', k); else { if (k like '#%') k := sprintf ('"id":"%s"', k); else { sa := DB.DBA.RDF_MQL_GET_WIKI_URI (k); k := sprintf ('"key":"%s"', k); } } qr := sprintf ('{"ROOT":{"query":[{%s, "type":[]}]}}', k); url := sprintf ('http://www.freebase.com/api/service/mqlread?queries=%U', qr); cnt := http_get (url, hdr); tree := json_parse (cnt); xt := get_keyword ('ROOT', tree); if (not isarray (xt)) return 0; xt := get_keyword ('result', xt); types := vector (); foreach (any tp in xt) do { declare tmp any; tmp := get_keyword ('type', tp); types := vector_concat (types, tmp); } --types := get_keyword ('type', xt); delete from DB.DBA.RDF_QUAD where g = iri_to_id(new_origin_uri); foreach (any tp in types) do { qr := sprintf ('{"ROOT":{"query":{%s, "type":"%s", "*":[]}}}', k, tp); url := sprintf ('http://www.freebase.com/api/service/mqlread?queries=%U', qr); cnt := http_get (url, hdr); --dbg_printf ('%s', cnt); tree := json_parse (cnt); xt := get_keyword ('ROOT', tree); xt := DB.DBA.MQL_TREE_TO_XML (tree); --dbg_obj_print (xt); xt := DB.DBA.RDF_MAPPER_XSLT (registry_get ('_cartridges_path_') || 'xslt/main/mql2rdf.xsl', xt, vector ('baseUri', coalesce (dest, graph_iri), 'wpUri', sa)); sa := ''; xd := serialize_to_UTF8_xml (xt); -- dbg_printf ('%s', xd); DB.DBA.RM_RDF_LOAD_RDFXML (xd, new_origin_uri, coalesce (dest, graph_iri)); } return 1; } </verbatim> ---+++mql2rdf.xsl: <verbatim> <?xml version="1.0" encoding="UTF-8"?> <!-- - - $Id: mql2rdf.xsl,v 1.10 2008/09/04 09:14:12 source Exp $ - - This file is part of the OpenLink Software Virtuoso Open-Source (VOS) - project. - - Copyright (C) 1998-2008 OpenLink Software - - This project is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; only version 2 of the License, dated June 1991. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --> <!DOCTYPE xsl:stylesheet [ <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <!ENTITY bibo "http://purl.org/ontology/bibo/"> <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY foaf "http://xmlns.com/foaf/0.1/"> <!ENTITY sioc "http://rdfs.org/sioc/ns#"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vi="http://www.openlinksw.com/virtuoso/xslt/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="&sioc;" xmlns:bibo="&bibo;" xmlns:foaf="&foaf;" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:dcterms= "http://purl.org/dc/terms/" xmlns:mql="http://www.freebase.com/"> <xsl:output method="xml" indent="yes" /> <xsl:param name="baseUri" /> <xsl:param name="wpUri" /> <xsl:variable name="ns">http://www.freebase.com/</xsl:variable> <xsl:template match="/"> <rdf:RDF> <xsl:if test="/results/ROOT/result/*"> <rdf:Description rdf:about="{$baseUri}"> <rdf:type rdf:resource="&foaf;Document"/> <rdf:type rdf:resource="&bibo;Document"/> <rdf:type rdf:resource="&sioc;Container"/> <sioc:container_of rdf:resource="{vi:proxyIRI($baseUri)}"/> <foaf:primaryTopic rdf:resource="{vi:proxyIRI($baseUri)}"/> <dcterms:subject rdf:resource="{vi:proxyIRI($baseUri)}"/> </rdf:Description> <rdf:Description rdf:about="{vi:proxyIRI($baseUri)}"> <rdf:type rdf:resource="&sioc;Item"/> <sioc:has_container rdf:resource="{$baseUri}"/> <xsl:apply-templates select="/results/ROOT/result/*"/> <xsl:if test="$wpUri != ''"> <rdfs:seeAlso rdf:resource="{$wpUri}"/> </xsl:if> </rdf:Description> </xsl:if> </rdf:RDF> </xsl:template> <xsl:template match="*[starts-with(.,'http://') or starts-with(.,'urn:')]"> <xsl:element namespace="{$ns}" name="{name()}"> <xsl:attribute name="rdf:resource"> <xsl:value-of select="vi:proxyIRI (.)"/> </xsl:attribute> </xsl:element> </xsl:template> <xsl:template match="*[starts-with(.,'/')]"> <xsl:if test="local-name () = 'type' and . like '%/person'"> <rdf:type rdf:resource="&foaf;Person"/> </xsl:if> <xsl:if test="local-name () = 'type'"> <sioc:topic> <skos:Concept rdf:about="{vi:proxyIRI (concat ($ns, 'view', .))}"/> </sioc:topic> </xsl:if> <xsl:element namespace="{$ns}" name="{name()}"> <xsl:attribute name="rdf:resource"> <xsl:value-of select="vi:proxyIRI(concat ($ns, 'view', .))"/> </xsl:attribute> </xsl:element> </xsl:template> <xsl:template match="*[* and ../../*]"> <xsl:element namespace="{$ns}" name="{name()}"> <xsl:attribute name="rdf:parseType">Resource</xsl:attribute> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="*"> <xsl:if test="* or . != ''"> <xsl:choose> <xsl:when test="name()='image'"> <foaf:depiction rdf:resource="{vi:mql-image-by-name (.)}"/> </xsl:when> <xsl:otherwise> <xsl:element namespace="{$ns}" name="{name()}"> <xsl:if test="name() like 'date_%'"> <xsl:attribute name="rdf:datatype">&xsd;dateTime</xsl:attribute> </xsl:if> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> </xsl:stylesheet> </verbatim>
sioc:id
ffb0ab272a6ca115739b1d11aaebcf45
sioc:link
n4:VirtSpongerCartridgeProgrammersGuide_Part3
sioc:has_container
n26:VOS
n6:has_services
n7:item
atom:title
VirtSpongerCartridgeProgrammersGuide_Part3
sioc:links_to
n11:html n4:OpenLink n12:html n13:html n15:html n17: n18: n19: n20:html n21:ns n22: n23:XHTML dc: n25:html foaf: vi: n28:html n29:core bibo: n31:rdf-schema n32:html n36:html n37:html n38:html n39:html n40:html n41:html n42:html n43:PingTheSemanticWeb n45:22-rdf-syntax-ns n21:types dcterms:
atom:source
n26:VOS
atom:author
n9:this
atom:published
2017-06-13T05:45:09Z
atom:updated
2017-06-29T07:41:07Z
sioc:topic
n26:VOS