001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.commons.rdf.api;
019
020/**
021 * A generalised "triple-like" interface, extended by {@link Triple} and
022 * {@link Quad}.
023 * <p>
024 * A TripleLike statement has at least a {@link #getSubject()},
025 * {@link #getPredicate()} and {@link #getObject()}, but unlike a {@link Triple}
026 * does not have a formalised {@link Triple#equals(Object)} or
027 * {@link Triple#hashCode()} semantics and is not required to be
028 * <em>immutable</em> or <em>thread-safe</em>. This interfaced can also be used
029 * for <em>generalised triples</em> (e.g. a {@link BlankNode} as predicate).
030 * <p>
031 * Implementations should specialise which specific {@link RDFTerm} types they
032 * return by overriding {@link #getSubject()}, {@link #getPredicate()} and
033 * {@link #getObject()}.
034 *
035 *
036 * @since 0.3.0-incubating
037 * @see Triple
038 * @see Quad
039 * @see QuadLike
040 */
041public interface TripleLike {
042
043    /**
044     * The subject of this statement.
045     *
046     * @return The subject, typically an {@link IRI} or {@link BlankNode}.
047     */
048    RDFTerm getSubject();
049
050    /**
051     * The predicate of this statement.
052     *
053     * @return The predicate, typically an {@link IRI}.
054     */
055    RDFTerm getPredicate();
056
057    /**
058     * The object of this statement.
059     *
060     * @return The object, typically an {@link IRI}, {@link BlankNode} or
061     *         {@link Literal}.
062     */
063    RDFTerm getObject();
064}