org.protempa.KnowledgeSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protempa-framework Show documentation
Show all versions of protempa-framework Show documentation
Protempa Framework is the core of Protempa.
/*
* #%L
* Protempa Framework
* %%
* Copyright (C) 2012 - 2013 Emory University
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.protempa;
import org.protempa.valueset.ValueSet;
import java.util.List;
import java.util.Set;
import org.protempa.backend.KnowledgeSourceBackendUpdatedEvent;
import org.protempa.backend.ksb.KnowledgeSourceBackend;
import org.protempa.query.And;
/**
* @author Andrew Post
*/
public interface KnowledgeSource extends Source {
/**
* Gets the mappings from term IDs to proposition IDs for each backend.
*
* @return a {@link Map} of {@link String}s to a {@link List} of
* String
s, with the keys being {@link Term} IDs and the values
* being lists of {@link PropositionDefinition} IDs.
*/
List getPropositionDefinitionsByTerm(And termSubsumptionClause) throws KnowledgeSourceReadException;
boolean hasAbstractionDefinition(String id) throws KnowledgeSourceReadException;
boolean hasPropositionDefinition(String id) throws KnowledgeSourceReadException;
boolean hasTemporalPropositionDefinition(String id) throws KnowledgeSourceReadException;
boolean hasContextDefinition(String id) throws KnowledgeSourceReadException;
boolean hasValueSet(String id) throws KnowledgeSourceReadException;
Set collectPropDefDescendantsUsingAllNarrower(boolean inDataSourceOnly, String... propIds) throws KnowledgeSourceReadException;
Set collectPropIdDescendantsUsingAllNarrower(boolean inDataSourceOnly, String... propIds) throws KnowledgeSourceReadException;
Set collectPropDefDescendantsUsingInverseIsA(String... propIds) throws KnowledgeSourceReadException;
Set collectPropIdDescendantsUsingInverseIsA(String... propIds) throws KnowledgeSourceReadException;
List readAbstractedFrom(AbstractionDefinition propDef) throws KnowledgeSourceReadException;
List readAbstractedFrom(String id) throws KnowledgeSourceReadException;
List readAbstractedInto(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readAbstractedInto(String propId) throws KnowledgeSourceReadException;
List readAbstractedIntoPropIds(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readAbstractedIntoPropIds(String id) throws KnowledgeSourceReadException;
AbstractionDefinition readAbstractionDefinition(String id) throws KnowledgeSourceReadException;
ContextDefinition readContextDefinition(String id) throws KnowledgeSourceReadException;
List readInverseIsA(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readInverseIsA(String id) throws KnowledgeSourceReadException;
List readIsA(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readIsA(String id) throws KnowledgeSourceReadException;
List readIsAPropIds(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readIsAPropIds(String id) throws KnowledgeSourceReadException;
List readSubContexts(String id) throws KnowledgeSourceReadException;
List readSubContexts(ContextDefinition contextDef) throws KnowledgeSourceReadException;
List readSubContextOfs(String id) throws KnowledgeSourceReadException;
List readSubContextOfs(ContextDefinition contextDef) throws KnowledgeSourceReadException;
List readSubContextOfPropIds(String id) throws KnowledgeSourceReadException;
List readSubContextOfPropIds(ContextDefinition contextDef) throws KnowledgeSourceReadException ;
List readInduces(String tempPropDef) throws KnowledgeSourceReadException;
List readInduces(TemporalPropositionDefinition tempPropDef) throws KnowledgeSourceReadException;
List readInducesPropIds(String id) throws KnowledgeSourceReadException;
List readInducesPropIds(TemporalPropositionDefinition tempPropDef) throws KnowledgeSourceReadException;
List readInducedBy(String contextId) throws KnowledgeSourceReadException;
List readInducedBy(ContextDefinition contextDef) throws KnowledgeSourceReadException;
/**
* Returns the specified proposition definition.
*
* @param id a proposition id {@link String}. Cannot be null
.
* @return a {@link PropositionDefinition}, or null
if none was
* found with the given id
.
* @throws KnowledgeSourceReadException if an error occurred reading from
* the knowledge base.
*/
PropositionDefinition readPropositionDefinition(String id) throws KnowledgeSourceReadException;
TemporalPropositionDefinition readTemporalPropositionDefinition(String id) throws KnowledgeSourceReadException;
ValueSet readValueSet(String id) throws KnowledgeSourceReadException;
List readParents(PropositionDefinition propDef)
throws KnowledgeSourceReadException;
List readParents(String propId)
throws KnowledgeSourceReadException;
List readParentPropIds(PropositionDefinition propDef) throws KnowledgeSourceReadException;
List readParentPropIds(String propId) throws KnowledgeSourceReadException;
List getMatchingPropIds(String searchKey) throws KnowledgeSourceReadException;
List readPropositionDefinitions(String... propIds) throws KnowledgeSourceReadException;
List readAbstractionDefinitions(String... propIds) throws KnowledgeSourceReadException;
List readTemporalPropositionDefinitions(String... propIds) throws KnowledgeSourceReadException;
List readContextDefinitions(String... propIds) throws KnowledgeSourceReadException;
}