@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
@Override public boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
@Override public <E extends OWLEntity> E getOWLEntity(EntityType<E> entityType) { return getOWLEntity(entityType, getIRI()); }
/** * Gets an entity that has the same IRI as this entity but is of the specified type. * @param entityType The type of the entity to obtain. This entity is not affected in any way. * @return An entity that has the same IRI as this entity and is of the specified type */ public <E extends OWLEntity> E getOWLEntity(EntityType<E> entityType) { return getOWLDataFactory().getOWLEntity(entityType, getIRI()); }
boolean inTBoxBefore = inTBox; inTBox = true; new OWLNamedIndividualImpl(cls.getIRI()).accept(this); inTBox = inTBoxBefore;
public static void serialize(SerializationStreamWriter streamWriter, OWLNamedIndividualImpl instance) throws SerializationException { streamWriter.writeString(instance.getIRI().toString()); }
@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
/** * Tests to see if this entity is of the specified type * @param entityType The entity type * @return <code>true</code> if this entity is of the specified type, otherwise <code>false</code>. */ public boolean isType(EntityType entityType) { return getEntityType().equals(entityType); }
@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
@Override public boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
@Override public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { return new OWLNamedIndividualImpl(iri); }
public OWLNamedIndividual getOWLNamedIndividual(IRI iri) { OWLNamedIndividual ind = individualsByURI.get(iri); if (ind == null) { ind = new OWLNamedIndividualImpl(this, iri); individualsByURI.put(iri, ind); } return ind; }
public static Set<OWLIndividual> readExamples(String filePath) throws IOException { Set<OWLIndividual> indivs = new TreeSet<>(); try(BufferedReader buffRead = new BufferedReader(new FileReader(new File(filePath)))){ String line; while ((line = buffRead.readLine()) != null) { line = line.trim(); line = line.substring(1, line.length()-1); // strip off angle brackets indivs.add(new OWLNamedIndividualImpl(IRI.create(line))); } } return indivs; } private static void setUp() {
private static Set<OWLIndividual> makeIndividuals(List<String> uris) { Set<OWLIndividual> individuals = new HashSet<>(); for (String uri : uris) { individuals.add(new OWLNamedIndividualImpl(IRI.create(uri))); } return individuals; } }
public static Set<OWLIndividual> makeExamples(Set<String> uris) { Set<OWLIndividual> indivs = new TreeSet<>(); for (String uri : uris) { indivs.add(new OWLNamedIndividualImpl(IRI.create(uri))); } return indivs; } public static Set<OWLIndividual> readExamples(String filePath) throws IOException {
private static Set<OWLIndividual> makeIndividuals(List<String> uris) { Set<OWLIndividual> individuals = new HashSet<>(); for (String uri : uris) { individuals.add(new OWLNamedIndividualImpl(IRI.create(uri))); } return individuals; } }
public static Set<OWLIndividual> readExamples(String filePath) throws IOException { Set<OWLIndividual> indivs = new TreeSet<>(); try(BufferedReader buffRead = new BufferedReader(new FileReader(new File(filePath)))){ String line; while ((line = buffRead.readLine()) != null) { line = line.trim(); line = line.substring(1, line.length()-1); // strip off angle brackets indivs.add(new OWLNamedIndividualImpl(IRI.create(line))); } } return indivs; } private static void setUp() {
/** * * @param id The session ID. * @param negativeExamples * @throws ClientNotKnownException Thrown if client (session ID) is not known. */ @WebMethod public void setNegativeExamples(int id, String[] negativeExamples) throws ClientNotKnownException { ClientState state = getState(id); Set<String> negExamples = new TreeSet<>(Arrays.asList(negativeExamples)); Set<OWLIndividual> inds = new HashSet<>(); for (String ex : negExamples) { inds.add(new OWLNamedIndividualImpl(IRI.create(ex))); } ((PosNegLP)state.getLearningProblem()).setNegativeExamples(inds); }