public abstract class SchemaRepositoryBase extends Object implements SchemaRepository
SchemaRepository.ElementTypeFilter| Modifier and Type | Field and Description |
|---|---|
protected Authorizations |
authorizations |
static int |
MAX_DISPLAY_NAME |
static String |
TOP_OBJECT_PROPERTY_NAME |
CONFIG_INTENT_CONCEPT_PREFIX, CONFIG_INTENT_PROPERTY_PREFIX, CONFIG_INTENT_RELATIONSHIP_PREFIX, PUBLIC, ROOT_CONCEPT_NAME, THING_CONCEPT_NAME, TYPE_CONCEPT, TYPE_PROPERTY, TYPE_RELATIONSHIP, VISIBILITY, VISIBILITY_STRING| Modifier | Constructor and Description |
|---|---|
protected |
SchemaRepositoryBase(Configuration configuration,
Graph graph,
CacheService cacheService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConceptTypeFilterToQuery(Query query,
Collection<SchemaRepository.ElementTypeFilter> filters,
String namespace) |
void |
addConceptTypeFilterToQuery(Query query,
String conceptName,
boolean includeChildNodes,
String namespace) |
void |
addEdgeLabelFilterToQuery(Query query,
Collection<SchemaRepository.ElementTypeFilter> filters,
String namespace) |
void |
addEdgeLabelFilterToQuery(Query query,
String edgeLabel,
boolean includeChildNodes,
String namespace) |
void |
addEntityGlyphIconToEntityConcept(Concept entityConcept,
byte[] rawImg,
boolean shouldFlush) |
protected abstract SchemaProperty |
addPropertyTo(List<Concept> concepts,
List<Relationship> relationships,
List<String> extendedDataTableNames,
String propertyName,
String displayName,
PropertyType dataType,
Map<String,String> possibleValues,
Collection<TextIndexHint> textIndexHints,
boolean userVisible,
boolean searchFacet,
boolean systemProperty,
String aggType,
int aggPrecision,
String aggInterval,
long aggMinDocumentCound,
String aggTimeZone,
String aggCalendarField,
boolean searchable,
boolean addable,
boolean sortable,
Integer sortPriority,
String displayType,
String propertyGroup,
Double boost,
String validationFormula,
String displayFormula,
com.google.common.collect.ImmutableList<String> dependentPropertyNames,
String[] intents,
boolean deleteable,
boolean updateable,
User user,
String namespace) |
protected void |
checkDeletePrivileges(User user,
String namespace) |
protected void |
checkPrivileges(User user,
String namespace) |
void |
clearCache() |
void |
clearCache(String namespace) |
protected void |
definePropertyOnGraph(Graph graph,
BcPropertyBase<?> property,
Class<? extends Value> dataType,
Set<TextIndexHint> textIndexHint) |
protected void |
definePropertyOnGraph(Graph graph,
String propertyName,
Class<? extends Value> dataType,
Collection<TextIndexHint> textIndexHint,
Double boost,
boolean sortable) |
protected void |
defineRequiredProperties(Graph graph) |
protected abstract void |
deleteChangeableProperties(SchemaElement element,
Authorizations authorizations) |
protected abstract void |
deleteChangeableProperties(SchemaProperty property,
Authorizations authorizations) |
void |
deleteConcept(String conceptTypeName,
User user,
String namespace) |
void |
deleteProperty(String propertyName,
User user,
String namespace) |
void |
deleteRelationship(String relationshipName,
User user,
String namespace) |
protected boolean |
determineSearchable(String propertyNames,
PropertyType dataType,
Collection<TextIndexHint> textIndexHints,
boolean searchable) |
String |
generateDynamicName(Class type,
String displayName,
String namespace,
String... extended) |
String |
generatePropertyDynamicName(Class type,
String displayName,
String namespace,
String prefix) |
Set<Concept> |
getAncestorConcepts(Concept concept,
String namespace) |
Set<Relationship> |
getAncestorRelationships(Relationship relationship,
String namespace) |
Authorizations |
getAuthorizations() |
abstract List<Concept> |
getChildConcepts(Concept concept,
String namespace) |
protected abstract List<Relationship> |
getChildRelationships(Relationship relationship,
String namespace) |
ClientApiSchema |
getClientApiObject(String namespace) |
Set<Concept> |
getConceptAndAllChildren(Concept concept,
String namespace) |
Set<Concept> |
getConceptAndAllChildrenByName(String conceptName,
String namespace) |
Set<Concept> |
getConceptAndAncestors(Concept concept,
String namespace) |
Concept |
getConceptByIntent(String intent,
String namespace) |
Concept |
getConceptByName(String conceptName,
String namespace) |
String |
getConceptNameByIntent(String intent,
String namespace) |
Iterable<Concept> |
getConceptsByName(List<String> conceptNames,
String namespace) |
Configuration |
getConfiguration() |
SchemaProperty |
getDependentPropertyParent(String name,
String namespace) |
protected abstract Graph |
getGraph() |
Schema |
getOntology(String namespace) |
Concept |
getOrCreateConcept(Concept parent,
String conceptName,
String displayName,
boolean deleteChangeableProperties,
boolean isCoreConcept)
Deprecated.
|
Concept |
getOrCreateConcept(Concept parent,
String conceptName,
String displayName,
boolean deleteChangeableProperties,
boolean isCoreConcept,
User user,
String namespace) |
Concept |
getOrCreateConcept(Concept parent,
String conceptName,
String displayName,
String glyphIconHref,
String color,
boolean deleteChangeableProperties,
boolean isCoreConcept,
User user,
String namespace) |
Concept |
getOrCreateConcept(Concept parent,
String conceptName,
String displayName,
String glyphIconHref,
String color,
User user,
String namespace) |
Concept |
getOrCreateConcept(Concept parent,
String conceptName,
String displayName,
User user,
String namespace) |
SchemaProperty |
getOrCreateProperty(SchemaPropertyDefinition schemaPropertyDefinition,
User user,
String namespace) |
Relationship |
getOrCreateRelationshipType(Relationship parent,
Iterable<Concept> domainConcepts,
Iterable<Concept> rangeConcepts,
String relationshipName,
boolean isDeclaredInOntology,
boolean coreConcept,
User user,
String namespace) |
Relationship |
getOrCreateRelationshipType(Relationship parent,
Iterable<Concept> domainConcepts,
Iterable<Concept> rangeConcepts,
String relationshipName,
String displayName,
boolean isDeclaredInOntology,
boolean coreConcept,
User user,
String namespace) |
Relationship |
getOrCreateRootRelationship(Authorizations authorizations) |
protected PrivilegeRepository |
getPrivilegeRepository() |
List<SchemaProperty> |
getPropertiesByIntent(String intent,
String namespace) |
Iterable<SchemaProperty> |
getPropertiesByName(List<String> propertyNames,
String namespace) |
<T extends BcProperty> |
getPropertyByIntent(String intent,
Class<T> propertyType,
String namespace) |
SchemaProperty |
getPropertyByIntent(String intent,
String namespace) |
SchemaProperty |
getPropertyByName(String propertyName,
String namespace) |
String |
getPropertyNameByIntent(String intent,
String namespace) |
Set<Relationship> |
getRelationshipAndAllChildren(Relationship relationship,
String namespace) |
Set<Relationship> |
getRelationshipAndAllChildrenByName(String relationshipName,
String namespace) |
Set<Relationship> |
getRelationshipAndAncestors(Relationship relationship,
String namespace) |
Relationship |
getRelationshipByIntent(String intent,
String namespace) |
Relationship |
getRelationshipByName(String relationshipName,
String namespace) |
String |
getRelationshipNameByIntent(String intent,
String namespace) |
Iterable<Relationship> |
getRelationshipsByName(List<String> relationshipNames,
String namespace) |
Concept |
getRequiredConceptByIntent(String intent,
String namespace) |
Concept |
getRequiredConceptByName(String name,
String namespace) |
String |
getRequiredConceptNameByIntent(String intent,
String namespace) |
<T extends BcProperty> |
getRequiredPropertyByIntent(String intent,
Class<T> propertyType,
String namespace) |
SchemaProperty |
getRequiredPropertyByIntent(String intent,
String namespace) |
SchemaProperty |
getRequiredPropertyByName(String propertyName,
String namespace) |
String |
getRequiredPropertyNameByIntent(String intent,
String namespace) |
Relationship |
getRequiredRelationshipByIntent(String intent,
String namespace) |
String |
getRequiredRelationshipNameByIntent(String intent,
String namespace) |
protected User |
getSystemUser() |
protected Relationship |
getTopObjectPropertyRelationship(String namespace) |
Map<String,String> |
getVisibleProperties(String[] keepOntologyProps) |
protected WorkspaceRepository |
getWorkspaceRepository() |
boolean |
hasConceptByName(String conceptName,
String namespace) |
boolean |
hasRelationshipByName(String relationshipName,
String namespace) |
protected abstract void |
internalDeleteConcept(Concept concept,
String namespace) |
protected abstract void |
internalDeleteProperty(SchemaProperty property,
String namespace) |
protected abstract void |
internalDeleteRelationship(Relationship relationship,
String namespace) |
protected abstract Concept |
internalGetOrCreateConcept(Concept parent,
String conceptName,
String displayName,
String glyphIconHref,
String color,
boolean deleteChangeableProperties,
boolean isCoreConcept,
User user,
String namespace) |
protected abstract Relationship |
internalGetOrCreateRelationshipType(Relationship parent,
Iterable<Concept> domainConcepts,
Iterable<Concept> rangeConcepts,
String relationshipName,
String displayName,
boolean isDeclaredInOntology,
boolean coreConcept,
User user,
String namespace) |
abstract void |
internalPublishConcept(Concept concept,
User user,
String namespace) |
abstract void |
internalPublishProperty(SchemaProperty property,
User user,
String namespace) |
abstract void |
internalPublishRelationship(Relationship relationship,
User user,
String namespace) |
protected boolean |
isPublic(String worksapceId) |
void |
loadOntologies() |
void |
publishConcept(Concept concept,
User user,
String namespace) |
void |
publishProperty(SchemaProperty property,
User user,
String namespace) |
void |
publishRelationship(Relationship relationship,
User user,
String namespace) |
void |
resolvePropertyIds(org.json.JSONArray filterJson,
String namespace) |
void |
setAuthorizations(Authorizations authorizations) |
void |
setIconProperty(Concept concept,
File inDir,
String glyphIconFileName,
String propertyKey,
User user,
Authorizations authorizations) |
protected void |
validateRelationship(String relationshipName,
Iterable<Concept> domainConcepts,
Iterable<Concept> rangeConcepts) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConceptTypeFilterToQuery, addConceptTypeFilterToQuery, addDomainConceptsToRelationshipType, addEdgeLabelFilterToQuery, addEdgeLabelFilterToQuery, addRangeConceptsToRelationshipType, getChildConcepts, getClientApiObject, getConceptAndAllChildren, getConceptAndAllChildrenByName, getConceptByIntent, getConceptByName, getConceptNameByIntent, getConcepts, getConceptsWithProperties, getConceptsWithProperties, getDependentPropertyParent, getDisplayNameForLabel, getDisplayNameForLabel, getOrCreateConcept, getOrCreateInverseOfRelationship, getOrCreateProperty, getOrCreateRelationshipType, getParentConcept, getParentConcept, getParentRelationship, getProperties, getProperties, getProperties, getPropertiesByIntent, getPropertyByIntent, getPropertyByIntent, getPropertyByName, getPropertyNameByIntent, getRelationshipAndAllChildren, getRelationshipByIntent, getRelationshipByName, getRelationshipNameByIntent, getRelationships, getRelationships, getRelationships, getRequiredConceptByIntent, getRequiredConceptByName, getRequiredConceptNameByIntent, getRequiredPropertyByIntent, getRequiredPropertyByIntent, getRequiredPropertyByName, getRequiredPropertyNameByIntent, getRequiredRelationshipByIntent, getRequiredRelationshipNameByIntent, getRootConcept, getThingConcept, getThingConcept, hasRelationshipByName, removeInverseOfRelationship, resolvePropertyIds, updatePropertyDependentNames, updatePropertyDependentNames, updatePropertyDomainNames, updatePropertyDomainNamespublic static final String TOP_OBJECT_PROPERTY_NAME
public static final int MAX_DISPLAY_NAME
protected Authorizations authorizations
@Inject protected SchemaRepositoryBase(Configuration configuration, Graph graph, CacheService cacheService)
public Relationship getOrCreateRootRelationship(Authorizations authorizations)
getOrCreateRootRelationship in interface SchemaRepositorypublic void addEntityGlyphIconToEntityConcept(Concept entityConcept, byte[] rawImg, boolean shouldFlush)
public void setIconProperty(Concept concept, File inDir, String glyphIconFileName, String propertyKey, User user, Authorizations authorizations) throws IOException
setIconProperty in interface SchemaRepositoryIOExceptionpublic SchemaProperty getOrCreateProperty(SchemaPropertyDefinition schemaPropertyDefinition, User user, String namespace)
getOrCreateProperty in interface SchemaRepositoryprotected abstract SchemaProperty addPropertyTo(List<Concept> concepts, List<Relationship> relationships, List<String> extendedDataTableNames, String propertyName, String displayName, PropertyType dataType, Map<String,String> possibleValues, Collection<TextIndexHint> textIndexHints, boolean userVisible, boolean searchFacet, boolean systemProperty, String aggType, int aggPrecision, String aggInterval, long aggMinDocumentCound, String aggTimeZone, String aggCalendarField, boolean searchable, boolean addable, boolean sortable, Integer sortPriority, String displayType, String propertyGroup, Double boost, String validationFormula, String displayFormula, com.google.common.collect.ImmutableList<String> dependentPropertyNames, String[] intents, boolean deleteable, boolean updateable, User user, String namespace)
public Set<Concept> getConceptAndAllChildrenByName(String conceptName, String namespace)
getConceptAndAllChildrenByName in interface SchemaRepositorypublic Set<Concept> getConceptAndAllChildren(Concept concept, String namespace)
getConceptAndAllChildren in interface SchemaRepositorypublic Set<Concept> getAncestorConcepts(Concept concept, String namespace)
getAncestorConcepts in interface SchemaRepositorypublic Set<Concept> getConceptAndAncestors(Concept concept, String namespace)
getConceptAndAncestors in interface SchemaRepositorypublic abstract List<Concept> getChildConcepts(Concept concept, String namespace)
getChildConcepts in interface SchemaRepositorypublic Set<Relationship> getRelationshipAndAllChildrenByName(String relationshipName, String namespace)
getRelationshipAndAllChildrenByName in interface SchemaRepositorypublic Set<Relationship> getRelationshipAndAllChildren(Relationship relationship, String namespace)
getRelationshipAndAllChildren in interface SchemaRepositorypublic Set<Relationship> getAncestorRelationships(Relationship relationship, String namespace)
getAncestorRelationships in interface SchemaRepositorypublic Set<Relationship> getRelationshipAndAncestors(Relationship relationship, String namespace)
getRelationshipAndAncestors in interface SchemaRepositorypublic boolean hasRelationshipByName(String relationshipName, String namespace)
hasRelationshipByName in interface SchemaRepositoryprotected abstract List<Relationship> getChildRelationships(Relationship relationship, String namespace)
public void resolvePropertyIds(org.json.JSONArray filterJson,
String namespace)
throws org.json.JSONException
resolvePropertyIds in interface SchemaRepositoryorg.json.JSONExceptionpublic Concept getConceptByName(String conceptName, String namespace)
getConceptByName in interface SchemaRepositorypublic Iterable<Concept> getConceptsByName(List<String> conceptNames, String namespace)
getConceptsByName in interface SchemaRepositorypublic boolean hasConceptByName(String conceptName, String namespace)
hasConceptByName in interface SchemaRepositorypublic SchemaProperty getPropertyByName(String propertyName, String namespace)
getPropertyByName in interface SchemaRepositorypublic Iterable<SchemaProperty> getPropertiesByName(List<String> propertyNames, String namespace)
getPropertiesByName in interface SchemaRepositorypublic SchemaProperty getRequiredPropertyByName(String propertyName, String namespace)
getRequiredPropertyByName in interface SchemaRepositorypublic Relationship getRelationshipByName(String relationshipName, String namespace)
getRelationshipByName in interface SchemaRepositorypublic Iterable<Relationship> getRelationshipsByName(List<String> relationshipNames, String namespace)
getRelationshipsByName in interface SchemaRepositorypublic Concept getConceptByIntent(String intent, String namespace)
getConceptByIntent in interface SchemaRepositorypublic String getConceptNameByIntent(String intent, String namespace)
getConceptNameByIntent in interface SchemaRepositorypublic Concept getRequiredConceptByIntent(String intent, String namespace)
getRequiredConceptByIntent in interface SchemaRepositorypublic String getRequiredConceptNameByIntent(String intent, String namespace)
getRequiredConceptNameByIntent in interface SchemaRepositorypublic Concept getRequiredConceptByName(String name, String namespace)
getRequiredConceptByName in interface SchemaRepositorypublic String generateDynamicName(Class type, String displayName, String namespace, String... extended)
generateDynamicName in interface SchemaRepositorypublic String generatePropertyDynamicName(Class type, String displayName, String namespace, String prefix)
generatePropertyDynamicName in interface SchemaRepositorypublic final Concept getOrCreateConcept(Concept parent, String conceptName, String displayName, User user, String namespace)
getOrCreateConcept in interface SchemaRepositorypublic final Concept getOrCreateConcept(Concept parent, String conceptName, String displayName, String glyphIconHref, String color, User user, String namespace)
getOrCreateConcept in interface SchemaRepository@Deprecated public final Concept getOrCreateConcept(Concept parent, String conceptName, String displayName, boolean deleteChangeableProperties, boolean isCoreConcept)
getOrCreateConcept in interface SchemaRepositorypublic final Concept getOrCreateConcept(Concept parent, String conceptName, String displayName, boolean deleteChangeableProperties, boolean isCoreConcept, User user, String namespace)
getOrCreateConcept in interface SchemaRepositorypublic final Concept getOrCreateConcept(Concept parent, String conceptName, String displayName, String glyphIconHref, String color, boolean deleteChangeableProperties, boolean isCoreConcept, User user, String namespace)
getOrCreateConcept in interface SchemaRepositoryprotected abstract Concept internalGetOrCreateConcept(Concept parent, String conceptName, String displayName, String glyphIconHref, String color, boolean deleteChangeableProperties, boolean isCoreConcept, User user, String namespace)
public final Relationship getOrCreateRelationshipType(Relationship parent, Iterable<Concept> domainConcepts, Iterable<Concept> rangeConcepts, String relationshipName, boolean isDeclaredInOntology, boolean coreConcept, User user, String namespace)
getOrCreateRelationshipType in interface SchemaRepositorypublic final Relationship getOrCreateRelationshipType(Relationship parent, Iterable<Concept> domainConcepts, Iterable<Concept> rangeConcepts, String relationshipName, String displayName, boolean isDeclaredInOntology, boolean coreConcept, User user, String namespace)
getOrCreateRelationshipType in interface SchemaRepositoryprotected abstract Relationship internalGetOrCreateRelationshipType(Relationship parent, Iterable<Concept> domainConcepts, Iterable<Concept> rangeConcepts, String relationshipName, String displayName, boolean isDeclaredInOntology, boolean coreConcept, User user, String namespace)
public Relationship getRelationshipByIntent(String intent, String namespace)
getRelationshipByIntent in interface SchemaRepositorypublic String getRelationshipNameByIntent(String intent, String namespace)
getRelationshipNameByIntent in interface SchemaRepositorypublic Relationship getRequiredRelationshipByIntent(String intent, String namespace)
getRequiredRelationshipByIntent in interface SchemaRepositorypublic String getRequiredRelationshipNameByIntent(String intent, String namespace)
getRequiredRelationshipNameByIntent in interface SchemaRepositorypublic SchemaProperty getPropertyByIntent(String intent, String namespace)
getPropertyByIntent in interface SchemaRepositorypublic String getPropertyNameByIntent(String intent, String namespace)
getPropertyNameByIntent in interface SchemaRepositorypublic SchemaProperty getRequiredPropertyByIntent(String intent, String namespace)
getRequiredPropertyByIntent in interface SchemaRepositorypublic String getRequiredPropertyNameByIntent(String intent, String namespace)
getRequiredPropertyNameByIntent in interface SchemaRepositorypublic SchemaProperty getDependentPropertyParent(String name, String namespace)
getDependentPropertyParent in interface SchemaRepositorypublic <T extends BcProperty> T getPropertyByIntent(String intent, Class<T> propertyType, String namespace)
getPropertyByIntent in interface SchemaRepositorypublic <T extends BcProperty> T getRequiredPropertyByIntent(String intent, Class<T> propertyType, String namespace)
getRequiredPropertyByIntent in interface SchemaRepositorypublic List<SchemaProperty> getPropertiesByIntent(String intent, String namespace)
getPropertiesByIntent in interface SchemaRepositorypublic ClientApiSchema getClientApiObject(String namespace)
getClientApiObject in interface SchemaRepositorypublic Schema getOntology(String namespace)
getOntology in interface SchemaRepositoryprotected Relationship getTopObjectPropertyRelationship(String namespace)
public void clearCache()
clearCache in interface SchemaRepositorypublic void clearCache(String namespace)
clearCache in interface SchemaRepositorypublic final Configuration getConfiguration()
protected void defineRequiredProperties(Graph graph)
protected void definePropertyOnGraph(Graph graph, BcPropertyBase<?> property, Class<? extends Value> dataType, Set<TextIndexHint> textIndexHint)
protected void definePropertyOnGraph(Graph graph, String propertyName, Class<? extends Value> dataType, Collection<TextIndexHint> textIndexHint, Double boost, boolean sortable)
protected boolean determineSearchable(String propertyNames, PropertyType dataType, Collection<TextIndexHint> textIndexHints, boolean searchable)
protected abstract Graph getGraph()
protected abstract void internalDeleteConcept(Concept concept, String namespace)
protected abstract void internalDeleteProperty(SchemaProperty property, String namespace)
protected abstract void internalDeleteRelationship(Relationship relationship, String namespace)
public void deleteConcept(String conceptTypeName, User user, String namespace)
deleteConcept in interface SchemaRepositorypublic void deleteProperty(String propertyName, User user, String namespace)
deleteProperty in interface SchemaRepositorypublic void deleteRelationship(String relationshipName, User user, String namespace)
deleteRelationship in interface SchemaRepositorypublic void addConceptTypeFilterToQuery(Query query, String conceptName, boolean includeChildNodes, String namespace)
addConceptTypeFilterToQuery in interface SchemaRepositorypublic void addConceptTypeFilterToQuery(Query query, Collection<SchemaRepository.ElementTypeFilter> filters, String namespace)
addConceptTypeFilterToQuery in interface SchemaRepositorypublic void addEdgeLabelFilterToQuery(Query query, String edgeLabel, boolean includeChildNodes, String namespace)
addEdgeLabelFilterToQuery in interface SchemaRepositorypublic void addEdgeLabelFilterToQuery(Query query, Collection<SchemaRepository.ElementTypeFilter> filters, String namespace)
addEdgeLabelFilterToQuery in interface SchemaRepositorypublic final void publishConcept(Concept concept, User user, String namespace)
publishConcept in interface SchemaRepositorypublic abstract void internalPublishConcept(Concept concept, User user, String namespace)
public final void publishRelationship(Relationship relationship, User user, String namespace)
publishRelationship in interface SchemaRepositorypublic abstract void internalPublishRelationship(Relationship relationship, User user, String namespace)
public void publishProperty(SchemaProperty property, User user, String namespace)
publishProperty in interface SchemaRepositorypublic abstract void internalPublishProperty(SchemaProperty property, User user, String namespace)
protected User getSystemUser()
protected PrivilegeRepository getPrivilegeRepository()
protected WorkspaceRepository getWorkspaceRepository()
protected abstract void deleteChangeableProperties(SchemaElement element, Authorizations authorizations)
protected abstract void deleteChangeableProperties(SchemaProperty property, Authorizations authorizations)
protected boolean isPublic(String worksapceId)
protected void validateRelationship(String relationshipName, Iterable<Concept> domainConcepts, Iterable<Concept> rangeConcepts)
public Authorizations getAuthorizations()
getAuthorizations in interface SchemaRepositorypublic void setAuthorizations(Authorizations authorizations)
public Map<String,String> getVisibleProperties(String[] keepOntologyProps)
getVisibleProperties in interface SchemaRepositoryCopyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.