. . . "VirtSparqlCxmlImport" . . "VirtSparqlCxmlImport" . . . "VirtSparqlCxmlImport" . . . "2017-06-13T05:36:56Z" . "2017-06-13T05:36:56Z" . . . . "---+Pivot Collections (Part 5)\n\n---++Contents\n\nPart 1: [[VirtSparqlCxml][Introduction]]\n\nPart 2: [[VirtSparqlCxml][SparqlCxml]]\n\nPart 3: [[VirtSparqlCxmlDzcs][SparqlCxml Deep Zoom Collections]]\n\nPart 4: [[VirtSparqlCxmlPivotViewer][PivotViewer]]\n\nPart 5: Importing CXML\n\n * [[#AncImportingCxml][Importing CXML]]\n * [[#AncCxmlToRdfImport][DB.DBA.CXML_TO_RDF_IMPORT_URL()]]\n * [[#AncGeneratedSubjectUris][Generated Subject URIs]]\n * [[#AncGeneratedPredicates][Generated Predicates]]\n * [[#AncPredsForCollectionAndItemAttributes][Predicates for Collection and Item Attributes]]\n * [[#AncPredsForItemFacets][Predicates for Item Facets]]\n * [[#AncConvertToCommonPreds][Converting Generated Predicates to Common Predicates]]\n\nPart 6: [[VirtSparqlCxmlFacetPivotBridge][Facet Pivot Bridge]]\n\nPart 7: [[VirtSparqlCxmlDETs][DETs : Persisting SPARQL Query Results to DAV]]\n\nPart 8: [[VirtSparqlCxmlFAQs][Frequently Asked Questions (FAQs)]]\n\nPart 9: [[VirtSparqlCxmlGlossary][Glossary]]\n\n---\n#AncImportingCxml\n---++Importing CXML\n\nAs well as being able to generate CXML from RDF, Virtuoso provides the facility to do the reverse and generate RDF from imported CXML. The sparql_cxml VAD includes the procedure:\n\n#AncCxmlToRdfImport\n---+++DB.DBA.CXML_TO_RDF_IMPORT_URL (in url varchar)
\n*Parameters*:\n * *url* : the URL of the CXML file to import\n\n*Usage examples*:\n * DB.DBA.CXML_TO_RDF_IMPORT_URL ('http://content.getpivot.com/Collections/uspresidents/uspresidents.cxml');\n * DB.DBA.CXML_TO_RDF_IMPORT_URL ('http://www.bluesware.ch/parlament/collection/Parlament.cxml');\n * DB.DBA.CXML_TO_RDF_IMPORT_URL ('http://pivot.lobsterpot.com.au/Collections/WindowsPhone7Pivot.cxml');\n * DB.DBA.CXML_TO_RDF_IMPORT_URL ('http://pivot.lobsterpot.com.au/collections/PASSChapters.cxml');\n * DB.DBA.CXML_TO_RDF_IMPORT_URL ('http://www.wssdemo.com/livepivot/collections/sharepoint/sharepoint.cxml');\n\nThe given CXML file is imported into a graph of the same name and can be queried like any other. e.g.\n\nDESCRIBE ?s FROM where { ?s ?p ?o }\n\nSELECT * FROM WHERE {?s ?p ?o . ?s virtcxml:FacetImage ?image . }\n\ndefine input:inference \"virtrdf-label\"\nDESCRIBE ?s from where { ?s ?p ?o }\n\nDeep Zoom images associated with the collection are also imported into the DZC_xxx tables used to serve DZIs when generating CXML (see VirtSparqlCxmlDzcs). Imported images are assigned to the virtcxml:FacetImage predicate. This can be used directly with the ?image reserved query variable in SELECT statements used for CXML generation. The second DESCRIBE example above exploits inferencing to use the imported images as images for a new dynamic collection. The virtrdf-label inference context includes an entry:\n\nvirtcxml:FacetImage owl:equivalentProperty foaf:depiction\n\nGraph virtcxml: in turn includes an entry:\n\nfoaf:depiction\n a virtcxml:FacetCategoryPattern ;\n virtcxml:FacetType \"Item/@virt:Image\" ;\n virtcxml:FacetDescription \"A facet for absolute URI of depiction of a collection item\" .\n\nwith the result that imported images associated with virtcxml:FacetImage automatically have a virtcxml:FacetType of \"Item/@virt:Image\" and are seen by DESCRIBE as candidate images for the dynamic collection.\n\n#AncGeneratedSubjectUris\n---+++Generated Subject URIs\n\nEach item in the collection receives its own subject URI. The subject URI takes the form: <{collection-URI}#{item-ID}>. \n\ne.g. Item #2565 in collection http://www.bluesware.ch/parlament/collection/Parlament.cxml\n\n\n \n \n . . .\n \n \n \n . . .\n\n is assigned subject URI <http://www.bluesware.ch/parlament/collection/Parlament.cxml#2565>\n\n#AncGeneratedPredicates\n---+++Generated Predicates\n\n#AncPredsForCollectionAndItemAttributes\n---++++Predicates for Collection and Item Attributes\n\nItem attributes Href, Description etc are mapped to predicates named virtcxml:Facet{attribute-name}, where:\n\nprefix virtcxml: <http://www.openlinksw.com/schemas/virtcxml#>\n\n\n| *CXML Entity* | *Attribute* | *Mapped to predicate* |\n| Item | Href | virtcxml:FacetHref |\n| Item | Description | virtcxml:FacetDescription |\n| Item | Image | virtcxml:FacetImage |\n| Item | Related | virtcxml:FacetRelated |\n| Collection | Copyright | virtcxml:FacetCopyright |\n\nRather than just holding an image number, predicate virtcxml:FacetImage holds the full path of the corresponding Deep Zoom image, for example http://www.bluesware.ch/parlament/collection/p_deepzoom/2023.dzi. The image number in the .cxml file is dereferenced through the collection's .dzc file, identified by the Items/@ImgBase attribute, to obtain the DZI path.\n\n#AncPredsForItemFacets\n---++++Predicates for Item Facets\n\nA predicate is generated for each facet category. The predicate URI takes the form virtcxml:Custom-{facet-category-name}\ne.g. A collection containing the following facet categories:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n...\n\nwhen imported, generates the predicates:\n\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Alter\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Amtsjahre\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Funktion\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Geburtsdatum\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Geschlecht\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Kanton\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Kinder\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Parlamentsmandate\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Partei\nhttp://www.openlinksw.com/schemas/virtcxml#Custom-Vorname\n\n\n#AncConvertToCommonPreds\n---++++Converting Generated Predicates to Common Predicates\n\nFollowing a CXML import, some of the generated predicates can be converted to more popular predicates using the Virtuoso/PL procedure DB.DBA.CXML_FACETS_TO_COMMON_PREDS. The affected predicates are detailed below:\n| *Generated Predicate* | *Converted To* |\n| virtcxml:FacetName | rdfs:label |\n| virtcxml:FacetDescription | dc:description |\n| virtcxml:FacetHref | sioc:links_to |\n| virtcxml:FacetImage | foaf:depiction |\n\n---+++++Usage Example:\n\nsparql clear graph ;\nsparql insert in { ?s ?p ?o } from where {?s ?p ?o};\nDB.DBA.CXML_FACETS_TO_COMMON_PREDS ('http://qq/1');\n" . . . "2017-06-13T05:36:56.276541"^^ . . . . . "2017-06-13T05:36:56.276541"^^ . . "d9a4b5acb52028d49673abc6a8d395d0" . . .