Class SimpleQuantityRanker

java.lang.Object
org.aksw.qa.annotation.sparql.SimpleQuantityRanker

public class SimpleQuantityRanker extends Object
  • Field Details

    • sparql

      private org.aksw.qa.commons.sparql.SPARQL sparql
    • DBPEDIA_ONTO_URI

      private static final String DBPEDIA_ONTO_URI
      See Also:
      Constant Field Values
  • Constructor Details

    • SimpleQuantityRanker

      public SimpleQuantityRanker()
  • Method Details

    • rank

      public String rank(Collection<String> uris)
      For property, counts how many relations with this property exist. The one with the most relations is returned. For classes, counts how many subtypes of this class are existing. the one with the most subtypes is returned. If properties and classes are among the uris, the one with the biggest count is returned.
      Parameters:
      uris -
      Returns:
    • constructQuery

      private String constructQuery(String uri)
    • disambiguateOntologyIsProperty

      public boolean disambiguateOntologyIsProperty(String uri)
      Checks if String is a property. Checks if string begins with: "http://dbpedia.org/ontology/" , if following character is lowercase, its a property. Only works for dbpedia.
      Parameters:
      uri - String to check.
      Returns:
      true if string is a property within dbpedia.
    • disambiguateOntologyIsClass

      public boolean disambiguateOntologyIsClass(String uri)
      Checks if String is a class. Checks if string begins with: "http://dbpedia.org/ontology/" , if following character is uppercase, its a class. Only works for dbpedia.
      Parameters:
      uri - String to check.
      Returns:
      true if string is a property within dbpedia.