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?

user840718
  • 1,563
  • 6
  • 29
  • 54

1 Answers1

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).

C. L.
  • 571
  • 1
  • 8
  • 26