Class SchemaMappingImpl

java.lang.Object
se.liu.ida.hefquin.base.data.mappings.impl.SchemaMappingImpl
All Implemented Interfaces:
SchemaMapping

public class SchemaMappingImpl extends Object implements SchemaMapping
  • Field Details

    • g2lMap

      protected final Map<org.apache.jena.graph.Node,Set<TermMapping>> g2lMap
      The keys of this map are global terms, and the value for each such global term is a set of all term mappings that have the global term as their TermMapping.getGlobalTerm(). The union of all the sets that are values in this map is exactly the same set of term mappings as the union of all the sets that are values in l2gMap.
    • l2gMap

      protected final Map<org.apache.jena.graph.Node,Set<TermMapping>> l2gMap
      The keys of this map are local terms, and the value for each such local term is a set of all term mappings that have the local term as an element of their TermMapping.getLocalTerms(). The union of all the sets that are values in this map is exactly the same set of term mappings as the union of all the sets that are values in g2lMap.
    • isEquivalenceOnly

      protected final boolean isEquivalenceOnly
  • Constructor Details

    • SchemaMappingImpl

      public SchemaMappingImpl(Map<org.apache.jena.graph.Node,Set<TermMapping>> g2lMap)
  • Method Details

    • populateL2G

      protected static boolean populateL2G(Map<org.apache.jena.graph.Node,Set<TermMapping>> g2lMap, Map<org.apache.jena.graph.Node,Set<TermMapping>> l2gMap)
      Populates the given l2gMap based on the given g2lMap and returns whether all the TermMappings in g2lMap are equivalence mappings only.
    • isEquivalenceOnly

      public boolean isEquivalenceOnly()
      Description copied from interface: SchemaMapping
      Checks whether the schema mapping only contains equivalence rules, e.g., owl:equivalentClass, owl:equivalentProperty Return true if the schema mapping consists solely of equivalence rules, false otherwise.
      Specified by:
      isEquivalenceOnly in interface SchemaMapping
    • applyToTriplePattern

      public SPARQLGraphPattern applyToTriplePattern(TriplePattern tp)
      Description copied from interface: SchemaMapping
      Applies this mapping to the given triple pattern and returns the resulting graph pattern. If this mapping is not relevant for the the given triple pattern (i.e., applying the mapping to the triple pattern does not have any effect), then the result of this function is simply the given triple pattern itself.
      Specified by:
      applyToTriplePattern in interface SchemaMapping
    • applyToSolutionMapping

      public Set<SolutionMapping> applyToSolutionMapping(SolutionMapping sm)
      Description copied from interface: SchemaMapping
      Applies this schema mapping to the given solution mapping, which is assumed to use the global schema for the vocabulary terms that it binds to its query variables. If this schema mapping is not relevant for anything mentioned in the given solution mapping (i.e., applying this schema mapping to the solution mapping does not have any effect), then the result of this function is simply a singleton set that contains the given solution mapping without any changes.
      Specified by:
      applyToSolutionMapping in interface SchemaMapping
    • applyInverseToSolutionMapping

      public Set<SolutionMapping> applyInverseToSolutionMapping(SolutionMapping sm)
      Description copied from interface: SchemaMapping
      Applies the inverse of this schema mapping to the given solution mapping, which is assumed to use the local schema for the vocabulary terms that it binds to its query variables. If this schema mapping is not relevant for anything mentioned in the given solution mapping (i.e., applying the inverse of this schema mapping to the solution mapping does not have any effect), then the result of this function is simply a singleton set that contains the given solution mapping without any changes.
      Specified by:
      applyInverseToSolutionMapping in interface SchemaMapping
    • applyToSolutionMapping

      protected Set<SolutionMapping> applyToSolutionMapping(SolutionMapping solMap, boolean useInverse)
    • extractGlobalTermsForLocalTerm

      protected Set<org.apache.jena.graph.Node> extractGlobalTermsForLocalTerm(Set<TermMapping> mappingsForTerm)
    • extractLocalTermsForGlobalTerm

      protected Set<org.apache.jena.graph.Node> extractLocalTermsForGlobalTerm(Set<TermMapping> mappingsForTerm)