Class FederationDescriptionReader

java.lang.Object
se.liu.ida.hefquin.federation.catalog.FederationDescriptionReader

public class FederationDescriptionReader extends Object
  • Field Details

  • Constructor Details

    • FederationDescriptionReader

      protected FederationDescriptionReader()
  • Method Details

    • readFromFile

      public static FederationCatalog readFromFile(String filename)
    • readFromFiles

      public static FederationCatalog readFromFiles(List<String> filenames)
    • readFromModel

      public static FederationCatalog readFromModel(org.apache.jena.rdf.model.Model fd)
    • readFromModels

      public static FederationCatalog readFromModels(List<org.apache.jena.rdf.model.Model> fds)
    • parseFedDescr

      public FederationCatalog parseFedDescr(String filename)
    • parseFedDescr

      public FederationCatalog parseFedDescr(List<String> filenames)
    • parseFedDescr

      public FederationCatalog parseFedDescr(org.apache.jena.rdf.model.Model fd)
    • createFederationMember

      protected FederationMember createFederationMember(org.apache.jena.rdf.model.Resource fedMember, String serviceURI, org.apache.jena.rdf.model.Model fd)
    • parseVocabMapping

      protected VocabularyMapping parseVocabMapping(org.apache.jena.rdf.model.Resource fm, org.apache.jena.rdf.model.Model fd)
      Attempts to retrieve and parse the vocabulary mapping associated with the given RDF resource fm, representing a FederationMember, in the given federation description fd. The method attempts to load the vocabulary mapping from the specified path or URL and caches the result for reuse. If no vocabulary mappings file is present, the method returns null.
      Parameters:
      fm - RDF resource for the federation member
      fd - RDF model of the federation description
      Returns:
      parsed VocabularyMapping, or null if not specified
      Throws:
      IllegalArgumentException - if the mapping file cannot be loaded or parsed
    • handleFixedEndpointInterface

      protected FederationMember handleFixedEndpointInterface(org.apache.jena.rdf.model.Resource iface, org.apache.jena.rdf.model.Resource protocol, VocabularyMapping vocabMap, org.apache.jena.rdf.model.Resource fedMember, org.apache.jena.rdf.model.Model fd, String serviceURI)
      Creates a federation member for a fixed endpoint interface (SPARQL, Bolt, GraphQL).
    • handleFragmentInterface

      protected FederationMember handleFragmentInterface(org.apache.jena.rdf.model.Resource iface, org.apache.jena.rdf.model.Resource protocol, VocabularyMapping vocabMap)
      Creates a federation member for a fragment interface (TPF, brTPF).
    • handleTemplateInterface

      protected FederationMember handleTemplateInterface(org.apache.jena.rdf.model.Resource iface, org.apache.jena.rdf.model.Resource protocol, VocabularyMapping vocabMap, org.apache.jena.rdf.model.Resource fedMember, org.apache.jena.rdf.model.Model fd, String serviceURI)
      Creates a federation member for a template-based interface, including parameter and mapping handling.
    • parseRMLMapping

      protected List<MappingExpression> parseRMLMapping(org.apache.jena.rdf.model.Resource fedMember, org.apache.jena.rdf.model.Model fd, String serviceURI)
    • createSPARQLEndpoint

      protected FederationMember createSPARQLEndpoint(String uri, VocabularyMapping vm)
    • createTPFServer

      protected FederationMember createTPFServer(String uri, VocabularyMapping vm)
    • createBRTPFServer

      protected FederationMember createBRTPFServer(String uri, VocabularyMapping vm)
    • createNeo4jServer

      protected FederationMember createNeo4jServer(String uri)
    • createGraphQLServer

      protected FederationMember createGraphQLServer(String uri)
    • createWrappedRESTEndpoint

      protected FederationMember createWrappedRESTEndpoint(String uri, List<RESTEndpoint.Parameter> params, List<MappingExpression> trMaps)
    • getSingleURIProperty

      protected String getSingleURIProperty(org.apache.jena.rdf.model.Resource iface, org.apache.jena.rdf.model.Property p, String errorMsg1, String errorMsg2)
      Returns the single URI value of the given property from the resource. Throws an exception if the property is missing, occurs more than once or is not a valid URI.
    • verifyExpectedURI

      protected URI verifyExpectedURI(String uriString)
      Verifies that the given string represents an HTTP URI or an HTTPS URI and, if so, returns that URI.
    • getAsURIString

      protected String getAsURIString(org.apache.jena.rdf.model.RDFNode n)
      Returns a string that represents a URI obtained from the given RDF node. In particular, if the node is a URI, then that URI is returned (as a string); if the node is an xsd:anyURI literal with a valid URI as its lexical form, then that URI is returned; otherwise, null is returned (including for the case that the given node is already null).