%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---+How to Use SPARQL to add missing isDefinedBy relations to an Ontology? ---++What? Using SPARQL to add missing isDefinedBy relations to an Ontology. ---++Why? isDefinedBy relations make Ontologies (TBox) more navigable using follow-your-nose pattern. This also makes ABox instance data more discoverable. ---++How? Use SPARQL to generate relations that associate Classes and Properties the Ontology that describes them. ---+++Example Using the Ontology for vCards In this example we will use: * Ontology Document URL: http://www.w3.org/2006/vcard/ns ; * Ontology URI: http://www.w3.org/2006/vcard/ns# ; * A local Named Graph IRI to host SPARQL Update (SPARUL) the new relations. ## Uncomment line below if using Virtuoso and executing SPARQL via iSQL or via an ODBC, JDBC, ADO.NET connection ## SPARQL ## Uncomment line (a SPARQL pragma) below if using Virtuoso and there isn't a local Named Graph holding triples retrieved from the Ontology URL ## DEFINE get:soft "add" INSERT INTO { ?s rdfs:isDefinedBy } FROM WHERE { ?s a ?o } ---+++Example Using the Recorded Media Ontology In this example we will use: * Ontology Document URL: http://www.w3.org/ns/ma-ont ; * Ontology URI: http://www.w3.org/ns/ma-ont# ; * A local Named Graph IRI to host SPARQL Update (SPARUL) the new relations. SPARQL INSERT INTO { ?s rdfs:isDefinedBy } FROM WHERE { ?s a ?o } ---++Related * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]