Package jade.content.schema

Examples of jade.content.schema.ConceptSchema


    try {
      // Add the primitive schema for binary data
      PrimitiveSchema stringSchema = (PrimitiveSchema) BasicOntology.getInstance().getSchema(BasicOntology.STRING);
      add(stringSchema);
      // Add the schema for a generic Serializable object
      ConceptSchema serializableSchema = new ConceptSchema(SERIALIZABLE);
      serializableSchema.add(SERIALIZABLE_VALUE, stringSchema);
      add(serializableSchema);
    }
    catch (Exception e) {
      // Should never happen
      e.printStackTrace();
View Full Code Here


    }
    else if (Predicate.class.isAssignableFrom(clazz)) {
      schema = new PredicateSchema(schemaName);
    }
    else {
      schema = new ConceptSchema(schemaName);
    }

    return schema;
  }
View Full Code Here

      }
    }
  }
 
  private void manageEnum(Class clazz, ObjectSchema schema) throws OntologyException {
    ConceptSchema cs = (ConceptSchema)schema;
   
    cs.add(ENUM_SLOT_NAME, (TermSchema)ontology.getSchema(String.class));

    // Add enum permitted values
    Enum[] enumValues = ((Class<? extends Enum>)clazz).getEnumConstants();
    String[] enumStrValues = new String[enumValues.length];
    for(int i=0; i<enumValues.length; i++) {
      enumStrValues[i] = enumValues[i].toString();
    }
    cs.addFacet(ENUM_SLOT_NAME, new PermittedValuesFacet(enumStrValues));
  }
View Full Code Here

TOP

Related Classes of jade.content.schema.ConceptSchema

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.