congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Role.relationships
Code IndexAdd Tabnine to your IDE (free)

How to use
relationships
method
in
ai.grakn.concept.Role

Best Java code snippets using ai.grakn.concept.Role.relationships (Showing top 3 results out of 315)

origin: ai.grakn/grakn-graql

/**
 * convert a given type to a map of relation types in which it can play roles
 * and the corresponding role types including entity type hierarchy
 * @param entryConcept to be converted
 * @return map of relation types in which it can play roles and the corresponding role types
 */
default Multimap<RelationshipType, Role> toRelationshipMultimap(T entryConcept){
  Multimap<RelationshipType, Role> relationMap = HashMultimap.create();
  toCompatibleRoles(entryConcept)
      .forEach(role -> role.relationships()
          .forEach(rel -> relationMap.put(rel, role)));
  return relationMap;
}
origin: ai.grakn/grakn-kb

/**
 *
 * @param role The Role to validate
 * @return An error message if the relates does not have a single incoming RELATES edge
 */
static Optional<String> validateHasSingleIncomingRelatesEdge(Role role){
  if(!role.relationships().findAny().isPresent()) {
    return Optional.of(VALIDATION_ROLE_TYPE_MISSING_RELATION_TYPE.getMessage(role.label()));
  }
  return Optional.empty();
}
origin: ai.grakn/grakn-kb

/**
 * Checks if the {@link Role} of the {@link Casting} has been linked to the {@link RelationshipType} of
 * the {@link Relationship} which the {@link Casting} connects to.
 *
 * @param role the {@link Role} which the {@link Casting} refers to
 * @param relationshipType the {@link RelationshipType} which should connect to the role
 * @param relationship the {@link Relationship} which the {@link Casting} refers to
 * @return an error if one is found
 */
private static Optional<String> roleNotLinkedToRelationShip(Role role, RelationshipType relationshipType, Relationship relationship){
  boolean notFound = role.relationships().
      noneMatch(innerRelationType -> innerRelationType.label().equals(relationshipType.label()));
  if(notFound){
    return Optional.of(VALIDATION_RELATION_CASTING_LOOP_FAIL.getMessage(relationship.id(), role.label(), relationshipType.label()));
  }
  return Optional.empty();
}
ai.grakn.conceptRolerelationships

Javadoc

Returns the RelationshipTypes that this Role takes part in.

Popular methods of Role

  • label
    Changes the Label of this Concept to a new one.
  • subs
    Returns the sub of this Role.
  • sup
  • isDeleted
  • isImplicit
  • labelId
  • players
    Returns a collection of the Types that can play this Role.

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JList (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now