This project has retired. For details please refer to its Attic page.
FunctionalSyntaxExtractorTest xref
View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *  http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.any23.extractor.rdf;
19  
20  import org.apache.any23.extractor.ExtractorFactory;
21  import org.apache.any23.extractor.html.AbstractExtractorTestCase;
22  import org.apache.any23.rdf.RDFUtils;
23  import org.eclipse.rdf4j.model.vocabulary.OWL;
24  import org.eclipse.rdf4j.model.vocabulary.RDF;
25  import org.eclipse.rdf4j.model.vocabulary.RDFS;
26  import org.junit.Test;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  import java.lang.invoke.MethodHandles;
31  
32  /**
33   * Test case for {@link FunctionalSyntaxExtractor}.
34   *
35   * @author Peter Ansell
36   * @author Hans Brende (hansbrende@apache.org)
37   */
38  public class FunctionalSyntaxExtractorTest extends AbstractExtractorTestCase {
39  
40      private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
41  
42      @Override
43      public ExtractorFactory<?> getExtractorFactory() {
44          return new FunctionalSyntaxExtractorFactory();
45      }
46  
47      @Test
48      public void testExampleFunctionalSyntax() {
49          assertExtract("/text/owl-functional/example-functionalsyntax.ofn");
50          logger.debug(dumpModelToNQuads());
51          assertStatementsSize(null, null, null, 2);
52          assertContains(RDFUtils.iri("http://example.org/example-manchestersyntax"), RDF.TYPE, OWL.ONTOLOGY);
53          assertContains(RDFUtils.iri("http://example.org/example-manchestersyntax#TestIndividual"), RDFS.COMMENT,
54                  "Test individual is a unique individual");
55      }
56  
57  }