Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLEntity


        if(!event.getUserId().equals(getUserId())) {
            return;
        }
        Watch<?> watch = event.getWatch();
        if(watch instanceof EntityBasedWatch) {
            OWLEntity entity = ((EntityBasedWatch) watch).getEntity();
            TreeNode tn = findTreeNode(entity.getIRI().toString());
            if(tn != null) {
                SubclassEntityData data = (SubclassEntityData) tn.getUserObject();
                data.clearWatches();
                updateTreeNodeRendering(tn);
            }
View Full Code Here


    /**
     * Called to update the browser text in the tree
     * @param event The event that describes the browser text change that happened.
     */
    protected void onEntityBrowserTextChanged(BrowserTextChangedEvent event) {
        OWLEntity entity = event.getEntity();
        TreeNode tn = findTreeNode(entity.getIRI().toString());
        if(tn == null) {
            return;
        }
        EntityData ed = (EntityData) tn.getUserObject();
        ed.setBrowserText(event.getNewBrowserText());
View Full Code Here

            // TODO: THIS NEEDS FIXING
            NoteEditorDialogController controller = new NoteEditorDialogController(new NoteContentEditorHandler() {
                @Override
                public void handleAccept(Optional<NoteContent> noteContent) {
                    if (noteContent.isPresent()) {
                        OWLEntity entity = DataFactory.getOWLClass(value);
                        DispatchServiceManager.get().execute(new AddNoteToEntityAction(getProjectId(), entity, noteContent.get()), new AsyncCallback<AddNoteToEntityResult>() {
                            @Override
                            public void onFailure(Throwable caught) {
                            }
View Full Code Here

        getService().setRelationships(getProjectId(), (OWLClass) entity, new OBOTermRelationships(new HashSet<OBORelationship>(relationships)), new OBOTermEditorApplyChangesAsyncCallback("Your changes to the term relationships have not been applied"));
    }

    @Override
    protected void displayEntity(OWLEntity entity) {
        OWLEntity current = getCurrentEntity();
        if(!(current instanceof OWLClass)) {
            editor.clearValue();
            return;
        }
        getService().getRelationships(getProjectId()(OWLClass) current, new AsyncCallback<OBOTermRelationships>() {
View Full Code Here

    @Override
    protected GetEntityRenderingResult execute(GetEntityRenderingAction action,
                                               final OWLAPIProject project,
                                               ExecutionContext executionContext) {
        OWLEntity entity = action.getEntity();
        HasGetFrameRendering renderer = project.getRenderingManager();
        return new GetEntityRenderingResult(renderer.getFrameRendering(entity));
    }
View Full Code Here

    public <T extends OWLEntity> List<T> getEntitiesOfType(EntityType<T> entityType) {
        checkNotNull(entityType);
        List<T> result = new ArrayList<T>();
        for(OWLPrimitiveData data : primitiveData) {
            if(data.getType().isEntityType()) {
                OWLEntity entity = (OWLEntity) data.getObject();
                if(entity.isType(entityType)) {
                    result.add((T) entity);
                }
            }
        }
        return result;
View Full Code Here

  }

  private void extractModule() {
    Set<OWLEntity> entities = new HashSet<OWLEntity>();
    for( String entityName : entityNames ) {
      OWLEntity entity = OntologyUtils.findEntity( entityName, loader.getAllOntologies() );
     
      if( entity == null )
        throw new PelletCmdException( "Entity not found in ontology: " + entityName );

      entities.add( entity );
View Full Code Here

    propertyName = options.getOption( "property" ).getValueAsString();

    OWLAPILoader loader = new OWLAPILoader();
    KnowledgeBase kb = loader.createKB( getInputFiles() );

    OWLEntity entity = OntologyUtils.findEntity( propertyName, loader.getAllOntologies() );

    if( entity == null )
      throw new PelletCmdException( "Property not found: " + propertyName );

    if( !(entity instanceof OWLObjectProperty) )
      throw new PelletCmdException( "Not an object property: " + propertyName );

    if( !((OWLObjectProperty) entity).isTransitive( loader.getAllOntologies() ) )
      throw new PelletCmdException( "Not a transitive property: " + propertyName );

    ATermAppl p = ATermUtils.makeTermAppl( entity.getIRI().toString() );

    ATermAppl c = null;
    boolean filter = false;

    if(options.getOption( "filter" ).exists())
    {
      String filterName = options.getOption( "filter" ).getValueAsString();     
      OWLEntity filterClass = OntologyUtils.findEntity( filterName, loader.getAllOntologies() );
      if(filterClass == null)
        throw new PelletCmdException( "Filter class not found: " + filterName );     
      if(!(filterClass instanceof OWLClass))
        throw new PelletCmdException( "Not a class: " + filterName );

      c = ATermUtils.makeTermAppl( filterClass.getIRI().toString() );

      filter = true;
    }

    POTaxonomyBuilder builder = null;
View Full Code Here

   * @param ontologies
   *            ontologies we are searching
   * @return an entity referenced in the given ontology that has the given URI
   *         or local name   */
  public static OWLEntity findEntity(String name, Set<OWLOntology> ontologies) {
    OWLEntity entity = null;
    for( OWLOntology ontology : ontologies ) {
      if( (entity = findEntity( name, ontology )) != null )
        break;
    }
    return entity;
View Full Code Here

   *            ontology we are searching
   * @return an entity referenced in the given ontology that has the given URI
   *         or local name
   */
  public static OWLEntity findEntity(String name, OWLOntology ontology) {
    OWLEntity entity = null;

    if( name.equals( "owl:Thing" ) )
      entity = OWL.Thing;
    else if( name.equals( "owl:Nothing" ) )
      entity = OWL.Nothing;
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.