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.rdfa;
    19
    20  import org.apache.any23.extractor.ExtractionContext;
    21  import org.apache.any23.extractor.ExtractionResult;
    22  import org.apache.any23.extractor.ExtractorDescription;
    23  import org.apache.any23.extractor.rdf.RDFParserFactory;
    24  import org.eclipse.rdf4j.rio.RDFParser;
    25  import org.semarglproject.vocab.RDFa;
    26
    27  /**
    28   * {@link org.apache.any23.extractor.Extractor} implementation for <a href="http://www.w3.org/TR/rdfa-syntax/">RDFa
    29   * 1.0</a> specification.
    30   *
    31   * @author Michele Mostarda (mostarda@fbk.eu)
    32   * @author Hans Brende (hansbrende@apache.org)
    33   */
    34  public class RDFaExtractor extends BaseRDFaExtractor {
    35
    36      /**
    37       * @deprecated since 2.4. This extractor has never supported these settings. Use {@link #RDFaExtractor()} instead.
    38       *
    39       * @param verifyDataType
    40       *            has no effect
    41       * @param stopAtFirstError
    42       *            has no effect
    43       */
    44      @Deprecated
    45      public RDFaExtractor(boolean verifyDataType, boolean stopAtFirstError) {
    46          this();
    47      }
    48
    49      /**
    50       * @deprecated since 2.4. This extractor has never supported this setting. Do not use.
    51       *
    52       * @param stopAtFirstError
    53       *            has no effect
    54       */
    55      @Deprecated
    56      @Override
    57      public void setStopAtFirstError(boolean stopAtFirstError) {
    58          super.setStopAtFirstError(stopAtFirstError);
    59      }
    60
    61      /**
    62       * @deprecated since 2.4. This extractor has never supported this setting. Do not use.
    63       *
    64       * @param verifyDataType
    65       *            has no effect
    66       */
    67      @Deprecated
    68      @Override
    69      public void setVerifyDataType(boolean verifyDataType) {
    70          super.setVerifyDataType(verifyDataType);
    71      }
    72
    73      public RDFaExtractor() {
    74          super(RDFa.VERSION_10);
    75      }
    76
    77      @Override
    78      public ExtractorDescription getDescription() {
    79          return RDFaExtractorFactory.getDescriptionInstance();
    80      }
    81
    82      /**
    83       * @deprecated since 2.4. This extractor no longer wraps an RDF4J {@link RDFParser}. Do not use this method.
    84       *
    85       * @param extractionContext
    86       *            the extraction context
    87       * @param extractionResult
    88       *            the extraction result
    89       *
    90       * @return a {@link RDFParser}
    91       */
    92      @Override
    93      @Deprecated
    94      protected RDFParser getParser(ExtractionContext extractionContext, ExtractionResult extractionResult) {
    95          return RDFParserFactory.getInstance().getRDFa10Parser(isVerifyDataType(), isStopAtFirstError(),
    96                  extractionContext, extractionResult);
    97      }
    98  }