예제 #1
0
  /* @see org.mindswap.owl.OWLProvider#castList(java.util.List, java.lang.Class) */
  public <T extends OWLIndividual> OWLIndividualList<T> castList(
      final List<? extends OWLIndividual> list, final Class<T> castTarget) {
    assert (list != null && castTarget != null)
        : "Illegal: list and/or cast target parameter was null.";

    final OWLIndividualList<T> result = createIndividualList();
    T element;
    for (final OWLIndividual individual : list) {
      element = individual.castTo(castTarget);
      result.add(element);
    }
    return result;
  }
예제 #2
0
 /**
  * @param <T>
  * @param prop
  * @param result
  * @return
  */
 protected <T extends OWLEntity> T getPropertyAs(
     final OWLObjectProperty prop, final Class<T> result) {
   final OWLIndividual value = individual.getProperty(prop);
   return (value == null) ? null : value.castTo(result);
 }
예제 #3
0
 /**
  * Simply query the ontology for contactInformation property and cast the result to an Actor
  * object.
  */
 public OwnerEntity getOwner() {
   final OWLIndividual ind = getServiceParameterValue(FLAServiceOnt.ownedBy);
   return (ind == null) ? null : ind.castTo(OwnerEntity.class);
 }
예제 #4
0
 /* (non-Javadoc)
  * @see org.mindswap.owls.process.Parameter#getProfile()
  */
 public Profile getProfile() {
   OWLIndividual ind = getIncomingProperty(OWLS.Profile.hasInput);
   return (ind == null) ? null : (Profile) ind.castTo(Profile.class);
 }
예제 #5
0
 /* (non-Javadoc)
  * @see org.mindswap.owls.process.Parameter#getProcess()
  */
 public Process getProcess() {
   OWLIndividual ind = getIncomingProperty(OWLS.Process.hasParameter);
   return (ind == null) ? null : (Process) ind.castTo(Process.class);
 }