Tabnine Logo
Role.sup
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: ai.grakn/migration-owl

@Override
public Concept visit(OWLSubObjectPropertyOfAxiom axiom) {
  if (!axiom.getSubProperty().isOWLObjectProperty() || !axiom.getSuperProperty().isOWLObjectProperty()) {
    return null;
  }
  RelationshipType subRelation = migrator.relation(axiom.getSubProperty().asOWLObjectProperty());
  RelationshipType superRelation = migrator.relation(axiom.getSuperProperty().asOWLObjectProperty());
  Map<Label, Label> roleMap = new HashMap<>();
  roleMap.put(migrator.namer().subjectRole(superRelation.getLabel()), migrator.namer().subjectRole(subRelation.getLabel()));
  roleMap.put(migrator.namer().objectRole(superRelation.getLabel()), migrator.namer().objectRole(subRelation.getLabel()));
  ReasonerUtils.createSubPropertyRule("Sub Property Rule Between [" + superRelation.getLabel() + "] and [" + subRelation.getLabel() +  "]", superRelation, subRelation, roleMap, migrator.tx());
  migrator.subjectRole(subRelation).sup(migrator.subjectRole(superRelation));
  migrator.objectRole(subRelation).sup(migrator.objectRole(superRelation));
  subRelation.sup(superRelation);
  return null;
}
origin: ai.grakn/grakn-kb

private void updateAttributeRelationHierarchy(AttributeType attributeType, Schema.ImplicitType has, Schema.ImplicitType hasValue, Schema.ImplicitType hasOwner,
                 Role ownerRole, Role valueRole, RelationshipType relationshipType){
  AttributeType attributeTypeSuper = attributeType.sup();
  Label superLabel = attributeTypeSuper.label();
  Role ownerRoleSuper = vertex().tx().putRoleTypeImplicit(hasOwner.getLabel(superLabel));
  Role valueRoleSuper = vertex().tx().putRoleTypeImplicit(hasValue.getLabel(superLabel));
  RelationshipType relationshipTypeSuper = vertex().tx().putRelationTypeImplicit(has.getLabel(superLabel)).
      relates(ownerRoleSuper).relates(valueRoleSuper);
  //Create the super type edges from sub role/relations to super roles/relation
  ownerRole.sup(ownerRoleSuper);
  valueRole.sup(valueRoleSuper);
  relationshipType.sup(relationshipTypeSuper);
  if (!Schema.MetaSchema.ATTRIBUTE.getLabel().equals(superLabel)) {
    //Make sure the supertype attribute is linked with the role as well
    ((AttributeTypeImpl) attributeTypeSuper).plays(valueRoleSuper);
    updateAttributeRelationHierarchy(attributeTypeSuper, has, hasValue, hasOwner, ownerRoleSuper, valueRoleSuper, relationshipTypeSuper);
  }
}
/**
origin: ai.grakn/grakn-grpc

  /**
   * Make the second argument the super of the first argument
   *
   * @throws GraqlQueryException if the types are different, or setting the super to be a meta-type
   */
  private static void setSuper(SchemaConcept subConcept, SchemaConcept superConcept) {
    if (superConcept.isEntityType()) {
      subConcept.asEntityType().sup(superConcept.asEntityType());
    } else if (superConcept.isRelationshipType()) {
      subConcept.asRelationshipType().sup(superConcept.asRelationshipType());
    } else if (superConcept.isRole()) {
      subConcept.asRole().sup(superConcept.asRole());
    } else if (superConcept.isAttributeType()) {
      subConcept.asAttributeType().sup(superConcept.asAttributeType());
    } else if (superConcept.isRule()) {
      subConcept.asRule().sup(superConcept.asRule());
    } else {
      throw GraqlQueryException.insertMetaType(subConcept.getLabel(), superConcept);
    }
  }
}
origin: ai.grakn/grakn-graql

/**
 * Make the second argument the super of the first argument
 *
 * @throws GraqlQueryException if the types are different, or setting the super to be a meta-type
 */
public static void setSuper(SchemaConcept subConcept, SchemaConcept superConcept) {
  if (superConcept.isEntityType()) {
    subConcept.asEntityType().sup(superConcept.asEntityType());
  } else if (superConcept.isRelationshipType()) {
    subConcept.asRelationshipType().sup(superConcept.asRelationshipType());
  } else if (superConcept.isRole()) {
    subConcept.asRole().sup(superConcept.asRole());
  } else if (superConcept.isAttributeType()) {
    subConcept.asAttributeType().sup(superConcept.asAttributeType());
  } else if (superConcept.isRule()) {
    subConcept.asRule().sup(superConcept.asRule());
  } else {
    throw GraqlQueryException.insertMetaType(subConcept.label(), superConcept);
  }
}
origin: ai.grakn/grakn-test-tools

authoredBy = tx.putRelationshipType("authored-by").relates(work).relates(author);
productionBeingDirected = tx.putRole("production-being-directed").sup(work);
director = tx.putRole("director").sup(author);
directedBy = tx.putRelationshipType("directed-by").sup(authoredBy)
    .relates(productionBeingDirected).relates(director);
ai.grakn.conceptRolesup

Popular methods of Role

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

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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