0

I have this piece of code:

        manager.addAxiom(
            ontology,factory.getOWLSubClassOfAxiom(
                    factory.getOWLClass("CCC", prefix ),
                    factory.getOWLObjectIntersectionOf(
                            Arrays.asList(
                                    factory.getOWLObjectComplementOf(
                                            factory.getOWLClass("AAA", prefix )),
                                    factory.getOWLClass("AAA", prefix )) )))  ;

As you can see I'm using Arrays.asList to represent a list of OWLClassExpressions. This worked for OWLAPI 5, but now I have to do the same for OWLAPI4 which doesn't support List, but only Set. How can I convert this code, which means using the inline constructor for Set class?

0

1 Answer 1

1

You could use

manager.addAxiom(
            ontology,factory.getOWLSubClassOfAxiom(
                    factory.getOWLClass("CCC", prefix ),
                    factory.getOWLObjectIntersectionOf(
                            new HashSet<T> (Arrays.asList(
                                    factory.getOWLObjectComplementOf(
                                            factory.getOWLClass("AAA", prefix )),
                                    factory.getOWLClass("AAA", prefix )) ))))  ;

where T is the type of the array elements (e.g. OWLClassExpression).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.