01: /*
02: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
03: [See end of file]
04: $Id: ReifierFragmentHandler.java,v 1.7 2008/01/02 12:05:18 andy_seaborne Exp $
05: */
06:
07: package com.hp.hpl.jena.graph.impl;
08:
09: import com.hp.hpl.jena.graph.Node;
10: import com.hp.hpl.jena.graph.Triple;
11:
12: /**
13: ReifierFragmentHandler: instances of this class handle fragments of reifications,
14: ie the triples (tag rdf:subject/predicate/object X) and (tag rdf:type Statement).
15: They are delivered from FragmentHandler instances and remain bound to
16: their originating instance.
17:
18: @author kers
19: */
20: public interface ReifierFragmentHandler {
21: /**
22: If this handler clashed with the complete reification of <code>reified</code>,
23: because its predicate and the given object aren't the same as that of
24: <code>reified</code>, add all five fragments to the its underlying
25: fragmentsMap and answer <code>true</code>; otherwise answer
26: <code>false</code>.
27:
28: @param fragmentObject the object of the reification fragment
29: @param reified the completely reified triple
30: @return true iff the fragment clashed with the triple
31: */
32: public abstract boolean clashedWith(Node tag, Node fragmentObject,
33: Triple reified);
34:
35: /**
36: If this <code>fragment</code> completes a reification for <code>tag</code>,
37: remove all the fragments from the underlying fragmentsMap and answer the
38: reified triple; otherwise add this fragment to the map and answer
39: <code>null</code>.
40:
41: @param fragment the new fragment to consider
42: @param tag the tag for the reification [equals the fragment subject]
43: @param object the object of the fragment. Hmm.
44: @return the reified triple, if there is one, otherwise null
45: */
46: public abstract Triple reifyIfCompleteQuad(Triple fragment,
47: Node tag, Node object);
48:
49: /**
50: * @param tag
51: * @param already
52: * @param fragment
53: * @return
54: */
55: public abstract Triple removeFragment(Node tag, Triple already,
56: Triple fragment);
57: }
58:
59: /*
60: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
61: All rights reserved.
62:
63: Redistribution and use in source and binary forms, with or without
64: modification, are permitted provided that the following conditions
65: are met:
66:
67: 1. Redistributions of source code must retain the above copyright
68: notice, this list of conditions and the following disclaimer.
69:
70: 2. Redistributions in binary form must reproduce the above copyright
71: notice, this list of conditions and the following disclaimer in the
72: documentation and/or other materials provided with the distribution.
73:
74: 3. The name of the author may not be used to endorse or promote products
75: derived from this software without specific prior written permission.
76:
77: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
78: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
79: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
80: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
81: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
82: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
83: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
84: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
85: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
86: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
87: */
|