• Topic
  • Discussion
  • VOS.VirtSetPrefixNames(Last) -- DAVWikiAdmin? , 2017-06-13 05:37:05 Edit WebDAV System Administrator 2017-06-13 05:37:05

    Set Standard Prefix Names for common vocabularies

    In order to set standard prefix names for common vocabularies on dumps to either .n3 or .ttl, you should use the xml_set_ns_decl Virtuoso function.

    The initial list of namespace declarations can be found by executing from iSQL or Conductor UI:


    SQL> SELECT * FROM DB.DBA.SYS_XML_PERSISTENT_NS_DECL;
    

    Example

    1. Load the ontology, for ex.:

      SQL> DB.DBA.RDF_LOAD_RDFXML (http_get('http://lod.taxonconcept.org/ontology/txn.owl'), '', 'http://lod.taxonconcept.org/ontology/txn.owl#'); Done. -- 109 msec.

    2. Check total triples retrieved:

      SQL>SPARQL SELECT COUNT(*) from <http://lod.taxonconcept.org/ontology/txn.owl#> WHERE {?s ?p ?o}; callret-0 INTEGER _______________________________________________________________________________ 495 1 Rows. -- 16 msec.

    3. Register the XML NS prefix:

      SQL>DB.DBA.XML_SET_NS_DECL ('txn', 'http://lod.taxonconcept.org/ontology/txn.owl#', 2); Done. -- 0 msec.

    4. Use the prefix, for ex. executing:

      SQL>SPARQL SELECT COUNT(*) WHERE { ?s ?p txn:SpeciesConcept }; callret-0 INTEGER _______________________________________________________________________________ 25 1 Rows. -- 0 msec.