
it.unibz.inf.ontop.model.atom.RDFAtomPredicate Maven / Gradle / Ivy
package it.unibz.inf.ontop.model.atom;
import com.google.common.collect.ImmutableList;
import it.unibz.inf.ontop.model.term.ImmutableTerm;
import org.apache.commons.rdf.api.IRI;
import java.util.Optional;
/**
* Abstraction for triples, quads and so on.
*/
public interface RDFAtomPredicate extends AtomPredicate {
Optional getClassIRI(ImmutableList extends ImmutableTerm> atomArguments);
Optional getPropertyIRI(ImmutableList extends ImmutableTerm> atomArguments);
/**
* Returns a class or (non rdf:type) property IRI if available
*/
Optional getPredicateIRI(ImmutableList extends ImmutableTerm> atomArguments);
Optional getGraphIRI(ImmutableList extends ImmutableTerm> atomArguments);
/**
* the type of the three getters
*/
@FunctionalInterface
interface ComponentGetter {
T get(ImmutableList atomArguments);
}
T getSubject(ImmutableList atomArguments);
T getProperty(ImmutableList atomArguments);
T getObject(ImmutableList atomArguments);
Optional getGraph(ImmutableList atomArguments);
ImmutableList updateSPO(ImmutableList originalArguments, T newSubject,
T newProperty, T newObject);
/**
* the type of the two updater methods
*/
@FunctionalInterface
interface ComponentUpdater {
ImmutableList update(ImmutableList originalArguments, T newComponent);
}
default ImmutableList updateSubject(ImmutableList originalArguments, T newSubject) {
return updateSPO(originalArguments, newSubject, getProperty(originalArguments), getObject(originalArguments));
}
default ImmutableList updateObject(ImmutableList originalArguments, T newObject) {
return updateSPO(originalArguments, getSubject(originalArguments), getProperty(originalArguments), newObject);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy