1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 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
-
-->
<refentry id="fn_rdf_graph_diff">
<refmeta>
<refentrytitle>DB.DBA.RDF_GRAPH_DIFF</refentrytitle>
<refmiscinfo>rdf</refmiscinfo>
</refmeta>
<refnamediv>
<refname>DB.DBA.RDF_GRAPH_DIFF</refname>
<refpurpose>performs the core operation of preparing graph diff.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_rdf_graph_diff">
<funcprototype id="fproto_rdf_graph_diff">
<funcdef><function>DB.DBA.RDF_GRAPH_DIFF</function></funcdef>
<paramdef>in <parameter>gfrom</parameter> IRI_ID</paramdef>
<paramdef>in <parameter>gto</parameter> IRI_ID</paramdef>
<paramdef>in <parameter>only_gfrom</parameter> any</paramdef>
<paramdef>in <parameter>only_gto</parameter> any</paramdef>
<paramdef>in <parameter>accuracy </parameter> integer</paramdef>
<paramdef>inout <parameter>fp_list</parameter> any</paramdef>
<paramdef>inout <parameter>invfp_list</parameter> any</paramdef>
<paramdef>inout <parameter>gfrom_rules</parameter> any</paramdef>
<paramdef>inout <parameter>gto_rules</parameter> any</paramdef>
<paramdef><optional>in <parameter>equiv_map</parameter> any := null</optional></paramdef>
<paramdef><optional>in <parameter>equiv_rev</parameter> any := null</optional></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_rdf_graph_diff">
<title>Description</title>
<para>Performs the core operation of preparing graph diff - matching between nodes of two graphs.</para>
<para>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.</para>
</refsect1>
<refsect1 id="params_rdf_graph_diff">
<title>Parameters</title>
<refsect2><title>gfrom</title>
<para>IRI ID of the from graph</para>
</refsect2>
<refsect2><title>gto</title>
<para>IRI ID of the destination graph</para>
</refsect2>
<refsect2><title>only_gfrom</title>
<para>Dictionaries of triples that present only in gfrom (but have no matches in gto)</para>
</refsect2>
<refsect2><title>only_gto</title>
<para>Dictionaries of triples that present only in gto (but have no matches in gfrom)</para>
</refsect2>
<refsect2><title>accuracy</title>
<para>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.</para>
</refsect2>
<refsect2><title>fp_list</title>
<para>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.</para>
</refsect2>
<refsect2><title>invfp_list</title>
<para>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:</para>
<itemizedlist mark="bullet">
<listitem>they're as compact as possible; </listitem>
<listitem>human readers undestand them better;</listitem>
<listitem>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 <link linkend="fn_rdf_graph_collect_fp_list">DB.DBA.RDF_GRAPH_COLLECT_FP_LIST</link>
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.</listitem>
</itemizedlist>
</refsect2>
<refsect2><title>fp_list</title>
<para>If NULL but accuracy is not zero then the function will call
<link linkend="fn_rdf_graph_collect_fp_list">DB.DBA.RDF_GRAPH_COLLECT_FP_LIST</link> internally, using graphs gfrom and gto as specimens.</para>
</refsect2>
<refsect2><title>invfp_list</title>
<para>If NULL but accuracy is not zero then the function will call
<link linkend="fn_rdf_graph_collect_fp_list">DB.DBA.RDF_GRAPH_COLLECT_FP_LIST</link> internally, using graphs gfrom and gto as specimens.</para>
</refsect2>
<refsect2><title>gfrom_rules</title>
<para>Describes how bnodes of graphs were matched, i.e., how sliders were moved along
chains of predicates.</para>
</refsect2>
<refsect2><title>gto_rules</title>
<para>Describes how bnodes of graphs were matched, i.e., how sliders were moved along chains of predicates.</para>
<para>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.</para>
</refsect2>
<refsect2><title>equiv_map</title>
<para>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.</para>
</refsect2>
<refsect2><title>equiv_rev</title>
<para>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.</para>
</refsect2>
</refsect1>
<refsect1 id="ret_rdf_graph_diff"><title>Return Types</title>
<para>any</para>
</refsect1>
<!--refsect1 id="examples_rdf_graph_diff">
<title>Examples</title>
<example id="ex_rdf_graph_diff"><title></title>
<para></para>
<programlisting><![CDATA[
]]></programlisting>
</example>
</refsect1-->
<refsect1 id="seealso_rdf_graph_diff">
<title>See Also</title>
<para><link linkend="fastapproxdiffandpatch">Fast Approximate RDF Graph Diff and Patch</link></para>
<para><link linkend="fn_rdf_suo_diff_ttl">DB.DBA.RDF_SUO_DIFF_TTL</link></para>
<para><link linkend="fn_rdf_suo_apply_patch">DB.DBA.RDF_SUO_APPLY_PATCH</link></para>
<para><link linkend="fn_rdf_graph_collect_fp_list">DB.DBA.RDF_GRAPH_COLLECT_FP_LIST</link></para>
</refsect1>
</refentry>
|