www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
db.dba.rdf_64bit_upg...
db.dba.rdf_audit_met...
db.dba.rdf_backup_me...
db.dba.rdf_convert_r...
db.dba.rdf_datatype_...
db.dba.rdf_graph_col...
db.dba.rdf_graph_dif...
db.dba.rdf_graph_gro...
db.dba.rdf_graph_gro...
db.dba.rdf_langmatch...
db.dba.rdf_load_rdfa
db.dba.rdf_load_rdfx...
db.dba.rdf_load_rdfx...
db.dba.rdf_quad_uri
db.dba.rdf_quad_uri_...
db.dba.rdf_quad_uri_...
db.dba.rdf_regex
db.dba.rdf_restore_m...
db.dba.rdf_suo_apply...
db.dba.rdf_suo_diff_...
db.dba.rdf_triples_t...
db.dba.rdf_triples_t...
db.dba.rdf_ttl2hash
db.dba.rdf_void_stor...
db.dba.sparql_eval
db.dba.sparql_eval_t...
db.dba.sparql_rdb2rd...
db.dba.sparql_rdb2rd...
db.dba.sparql_rexec
db.dba.sparql_rexec_...
db.dba.sparql_rexec_...
db.dba.sparql_select...
db.dba.ttlp
db.dba.ttlp_mt
db.dba.ttlp_mt_local...
group_concat
group_digest
isref
rdf_view_sync_to_phy...
sample
__xml_get_ns_prefix
__xml_get_ns_uri
http_nt_triple
http_ttl_triple
iri_split
ld_dir
rdfs_rule_set
sparql_to_sql_text
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
XML
XPATH & XQUERY

Functions Index

DB.DBA.RDF_GRAPH_DIFF

performs the core operation of preparing graph diff.
DB.DBA.RDF_GRAPH_DIFF (in gfrom IRI_ID, in gto IRI_ID, in only_gfrom any, in only_gto any, in accuracy integer, inout fp_list any, inout invfp_list any, inout gfrom_rules any, inout gto_rules any, [in equiv_map any := null], [in equiv_rev any := null]);
Description

Performs the core operation of preparing graph diff - matching between nodes of two graphs.

Typically is called from wrapper that returns the diff in an extended GUO ontology (http://webr3.org/owl/guo#) as a string output in TURTLE syntax.

Parameters
gfrom – IRI ID of the from graph
gto – IRI ID of the destination graph
only_gfrom – Dictionaries of triples that present only in gfrom (but have no matches in gto)
only_gto – Dictionaries of triples that present only in gto (but have no matches in gfrom)
accuracy – Tells the procedure what should be done if one or both graphs contain blank nodes. If zero then different bnodes are treated as distinct. Bnodes are allocated individually for each data load, so even if one and the same resource is loaded in two different graphs then these graphs will contain no blank nodes in common, accuracy=0 would result in the diff containing all triples from both graphs that have bnode subject o object. If nonzero then the procedure will try to match blank nodes, zipper style. In this case rest of arguments comes to play.
fp_list – Vector of IRI_IDs of predicates that are supposed to be functional properties, i.e., any given subject has no more than one value of a given predicate.
invfp_list – Vector of IRI_IDs of (supposedly) inverse functional properties, i.e., any given object could be the value of a given predicate for no more than one subject. The best source of such vectors is a good ontology suitable for both graphs. Types owl:functionalProperty and owl:inverseFunctionalProperty will provide truly "meaningful" lists of predicates that will provide really "meaningful" patch. Meaningful patches have three important advantages:
  • they're as compact as possible;
  • human readers undestand them better;
  • when a diff is applied to a graph that differs from gfrom then either the result is accurate and satisfies the ontology or the patch procedure reports meaningful conflicts. If the ontology is not specified then DB.DBA.RDF_GRAPH_COLLECT_FP_LIST can be used to build these list on some representative collection of similar graphs. That's "better than nothing", but the quality of the resulting diffs may be worse if some predicates only occasionally have one object per subject or one subject per object in sample graps or if some functional/inverse functional predicates are not used in sample graphs but appear in graphs to diff. Remember, diff on graphs with blank nodes is based on heuristics, it's better to run it on sound data, not on results of other heuristics.
fp_list – If NULL but accuracy is not zero then the function will call DB.DBA.RDF_GRAPH_COLLECT_FP_LIST internally, using graphs gfrom and gto as specimens.
invfp_list – If NULL but accuracy is not zero then the function will call DB.DBA.RDF_GRAPH_COLLECT_FP_LIST internally, using graphs gfrom and gto as specimens.
gfrom_rules – Describes how bnodes of graphs were matched, i.e., how sliders were moved along chains of predicates.
gto_rules – Describes how bnodes of graphs were matched, i.e., how sliders were moved along chains of predicates. Every event during matching of bnodes produces a rule that should be followed when the patch will scan its input graph for bnodes to edit.
equiv_map – Dictionary that describe the match between bnodes in gfrom and gto. In equiv_map, bnodes from gfrom are keys and matching bnodes from gto are values.
equiv_rev – Dictionary that describes the match between bnodes in gfrom and gto. In equiv_rev, same pairs are in different roles, bnodes from gfrom are values for matching bnodes from gto that are now keys. These data can be incomplete or NULL at all, but if provided then the function will trust them blindly.
Return Types

any

See Also

Fast Approximate RDF Graph Diff and Patch

DB.DBA.RDF_SUO_DIFF_TTL

DB.DBA.RDF_SUO_APPLY_PATCH

DB.DBA.RDF_GRAPH_COLLECT_FP_LIST