Class MetadataRegistry

java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.mdr.services.MetadataRegistry
All Implemented Interfaces:
NewerNewStyleService, STService

@STService public class MetadataRegistry extends STServiceAdapter
This service class allows the management of the metadata about remote datasets.
  • Constructor Details

    • MetadataRegistry

      public MetadataRegistry()
  • Method Details

    • setMetadataRegistry

      @Autowired public void setMetadataRegistry(STMetadataRegistryBackend metadataRegistryBackend)
    • setResourceLocator

      @Autowired public void setResourceLocator(ResourceLocator resourceLocator)
    • createConcreteDataset

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'C\')") public AnnotatedValue<org.eclipse.rdf4j.model.IRI> createConcreteDataset(String datasetLocalName, String uriSpace, @Optional org.eclipse.rdf4j.model.Literal title, @Optional org.eclipse.rdf4j.model.Literal description, @Optional Boolean dereferenceable, @Optional @JsonSerialized it.uniroma2.art.semanticturkey.mdr.core.Distribution distribution, @Optional @JsonSerialized it.uniroma2.art.semanticturkey.mdr.core.AbstractDatasetAttachment abstractDatasetAttachment) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Creates a new concrete dataset.
      Parameters:
      datasetLocalName - if null passed, a named is generated for the dataset
      uriSpace - the current URI space of the dataset, as its concrete distributions may introduce futher ones
      title - the current title of the dataset
      description - the current description of the dataset
      dereferenceable - whether the dataset is dereferenceable: null means unknown
      distribution - the distribution associated with the dataset, which also determines the dataset nature
      abstractDatasetAttachment - optional connection to an abstract dataset
      Returns:
      the IRI of the newly created dataset
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • listRootDatasets

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Collection<it.uniroma2.art.semanticturkey.mdr.core.CatalogRecord2> listRootDatasets()
      Returns root datasets, i.e. datasets (either abstract or concrete) that are not connect to another (abstract) dataset (e.g. as a version, master copy or LOD version thereof)
      Returns:
      a collection of records for root datasets
    • listConnectedDatasets

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Collection<it.uniroma2.art.semanticturkey.mdr.core.CatalogRecord2> listConnectedDatasets(org.eclipse.rdf4j.model.IRI abstractDataset)
      Returns the datasets connected to a given abstract dataset, e.g. as a version, master copy or LOD version thereof
      Parameters:
      abstractDataset - an abstract dataset
      Returns:
      a collection of datasets connected to the given abstract dataset
    • connectToAbstractDataset

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void connectToAbstractDataset(org.eclipse.rdf4j.model.IRI dataset, @JsonSerialized it.uniroma2.art.semanticturkey.mdr.core.AbstractDatasetAttachment abstractDatasetAttachment) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Connect a root concrete dataset to an abstract dataset
      Parameters:
      dataset -
      abstractDatasetAttachment -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • disconnectFromAbstractDataset

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void disconnectFromAbstractDataset(org.eclipse.rdf4j.model.IRI dataset, org.eclipse.rdf4j.model.IRI abstractDataset) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Disconnect a dataset from an abstract dataset
      Parameters:
      dataset -
      abstractDataset -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • spawnNewAbstractDataset

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'C\')") public AnnotatedValue<org.eclipse.rdf4j.model.IRI> spawnNewAbstractDataset(org.eclipse.rdf4j.model.IRI dataset1, @JsonSerialized it.uniroma2.art.semanticturkey.mdr.core.AbstractDatasetAttachment abstractDatasetAttachment1, org.eclipse.rdf4j.model.IRI dataset2, @JsonSerialized it.uniroma2.art.semanticturkey.mdr.core.AbstractDatasetAttachment abstractDatasetAttachment2, String datasetLocalName, String uriSpace, @Optional org.eclipse.rdf4j.model.Literal title, @Optional org.eclipse.rdf4j.model.Literal description, @Optional Boolean dereferenceable) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Spawn a new abstract dataset grouping two existing root concrete datasets
      Parameters:
      dataset1 -
      abstractDatasetAttachment1 -
      dataset2 -
      abstractDatasetAttachment2 -
      datasetLocalName -
      uriSpace -
      title -
      description -
      dereferenceable -
      Returns:
      the newly created abstract dataset
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • setDereferenciability

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void setDereferenciability(org.eclipse.rdf4j.model.IRI dataset, @Optional Boolean value) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Sets whether a dataset is derefereanceable or not. If value is true, then sets mdreg:standardDereferenciation and if false sets mdreg:noDereferenciation. If is not passed, the dereferenciation system is left unspecified.
      Parameters:
      dataset -
      value -
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • setSPARQLEndpoint

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void setSPARQLEndpoint(org.eclipse.rdf4j.model.IRI dataset, @Optional org.eclipse.rdf4j.model.IRI endpoint) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Sets the SPARQL endpoint of a dataset.
      Parameters:
      dataset -
      endpoint - if null, the endpoint is left unspecified
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • setTitle

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void setTitle(org.eclipse.rdf4j.model.IRI dataset, org.eclipse.rdf4j.model.Literal title) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Sets the title of a dataset. This operation also deletes any existing title of the dataset in the same language.
      Parameters:
      dataset -
      title -
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • deleteTitle

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void deleteTitle(org.eclipse.rdf4j.model.IRI dataset, @Optional org.eclipse.rdf4j.model.Literal title) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Deletes a title of a dataset. If no title is specified, then all titles are deleted.
      Parameters:
      dataset -
      title -
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • setDescription

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void setDescription(org.eclipse.rdf4j.model.IRI dataset, org.eclipse.rdf4j.model.Literal description) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Sets the description of a dataset. This operation also deletes any existing description of the dataset in the same language.
      Parameters:
      dataset -
      description -
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • deleteDescription

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void deleteDescription(org.eclipse.rdf4j.model.IRI dataset, @Optional org.eclipse.rdf4j.model.Literal description) throws IllegalArgumentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Deletes a description of a dataset. If no title is specified, then all descriptions are deleted.
      Parameters:
      dataset -
      description -
      Throws:
      IllegalArgumentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • setSPARQLEndpointLimitation

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void setSPARQLEndpointLimitation(org.eclipse.rdf4j.model.IRI endpoint, org.eclipse.rdf4j.model.IRI limitation) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Sets the given limitation for the provided endpoint
      Parameters:
      endpoint -
      limitation -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • removeSPARQLEndpointLimitation

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void removeSPARQLEndpointLimitation(org.eclipse.rdf4j.model.IRI endpoint, org.eclipse.rdf4j.model.IRI limitation) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Removes the given limitation from the provided endpoint
      Parameters:
      endpoint -
      limitation -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • getSPARQLEndpointLimitations

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Collection<org.eclipse.rdf4j.model.IRI> getSPARQLEndpointLimitations(org.eclipse.rdf4j.model.IRI endpoint)
      Returns the limitations associated with the provided endpoint
      Parameters:
      endpoint -
    • deleteCatalogRecord

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'D\')") public void deleteCatalogRecord(org.eclipse.rdf4j.model.IRI catalogRecord) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Deletes a catalog record
      Parameters:
      catalogRecord -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • getDatasetMetadata

      @STServiceOperation public it.uniroma2.art.semanticturkey.mdr.core.DatasetMetadata getDatasetMetadata(org.eclipse.rdf4j.model.IRI dataset) throws it.uniroma2.art.semanticturkey.mdr.core.NoSuchDatasetMetadataException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryStateException
      Returns metadata about a given dataset
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryStateException
      it.uniroma2.art.semanticturkey.mdr.core.NoSuchDatasetMetadataException
    • addEmbeddedLexicalizationSet

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'C\')") public void addEmbeddedLexicalizationSet(org.eclipse.rdf4j.model.IRI dataset, @Optional org.eclipse.rdf4j.model.IRI lexicalizationSet, @Optional org.eclipse.rdf4j.model.IRI lexiconDataset, org.eclipse.rdf4j.model.IRI lexicalizationModel, String language, @Optional BigInteger references, @Optional BigInteger lexicalEntries, @Optional BigInteger lexicalizations, @Optional BigDecimal percentage, @Optional BigDecimal avgNumOfLexicalizations) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Adds an embedded lexicalization set for a dataset.
      Parameters:
      dataset -
      lexicalizationSet - if null is passed, a local IRI is created
      lexiconDataset -
      lexicalizationModel -
      language -
      references -
      lexicalEntries -
      lexicalizations -
      percentage -
      avgNumOfLexicalizations -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • deleteEmbeddedLexicalizationSet

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'D\')") public void deleteEmbeddedLexicalizationSet(org.eclipse.rdf4j.model.IRI lexicalizationSet) throws it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryStateException
      Delete an embedded lexicalization set
      Parameters:
      lexicalizationSet -
      Throws:
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryStateException
    • getEmbeddedLexicalizationSets

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Collection<it.uniroma2.art.semanticturkey.mdr.core.LexicalizationSetMetadata> getEmbeddedLexicalizationSets(org.eclipse.rdf4j.model.IRI dataset)
      Returns metadata about the lexicalization sets embedded in a given dataset
    • getEmbeddedLinksets

      @STServiceOperation public Collection<it.uniroma2.art.semanticturkey.mdr.core.LinksetMetadata> getEmbeddedLinksets(org.eclipse.rdf4j.model.IRI dataset, @Optional(defaultValue="0") long treshold, @Optional(defaultValue="false") boolean coalesce)
      Returns metadata about the linksets sets embedded in a given dataset
      Parameters:
      dataset -
      treshold - minimum number of links (before linkset coalescing)
      coalesce - whether or not merge linksets for the same pair of datasets
      Returns:
    • assessLexicalizationModel

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'U\')") public void assessLexicalizationModel(org.eclipse.rdf4j.model.IRI dataset) throws it.uniroma2.art.maple.orchestration.AssessmentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Consults the dataset (in the best possible way going from more to less noble availabilities: localProject --> SPARQLendpoint --> http-dereferenciation) in order to assess its lexicalization model.
      Parameters:
      dataset -
      Throws:
      it.uniroma2.art.maple.orchestration.AssessmentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • getComputedLexicalizationModel

      @STServiceOperation(method=GET) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public org.eclipse.rdf4j.model.IRI getComputedLexicalizationModel(org.eclipse.rdf4j.model.IRI dataset) throws it.uniroma2.art.maple.orchestration.AssessmentException, it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
      Get lexicalization model
      Parameters:
      dataset -
      Returns:
      the lexicalization model or null if it can't be determined
      Throws:
      it.uniroma2.art.maple.orchestration.AssessmentException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataRegistryWritingException
    • findDataset

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public ResourcePosition findDataset(org.eclipse.rdf4j.model.IRI iri) throws ProjectAccessException
      Find a dataset matching the given IRI.
      Parameters:
      iri -
      Returns:
      Throws:
      ProjectAccessException
    • findDatasets

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Collection<ResourcePosition> findDatasets(org.eclipse.rdf4j.model.IRI iri) throws ProjectAccessException
      Find all datasets matching the given IRI.
      Parameters:
      iri -
      Returns:
      Throws:
      ProjectAccessException
    • discoverDatasetMetadata

      @STServiceOperation public it.uniroma2.art.semanticturkey.mdr.core.DatasetMetadata discoverDatasetMetadata(org.eclipse.rdf4j.model.IRI iri) throws ProjectAccessException, DeniedOperationException, it.uniroma2.art.semanticturkey.mdr.core.MetadataDiscoveryException
      Discover the metadata for a dataset given an IRI. If discovery is unsuccessful, an exception is thrown.
      Parameters:
      iri -
      Returns:
      the newly created dcat:CatalogRecord for the discovered dataset
      Throws:
      ProjectAccessException
      DeniedOperationException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataDiscoveryException
    • discoverDataset

      @STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'C\')") public AnnotatedValue<org.eclipse.rdf4j.model.IRI> discoverDataset(org.eclipse.rdf4j.model.IRI iri) throws ProjectAccessException, DeniedOperationException, it.uniroma2.art.semanticturkey.mdr.core.MetadataDiscoveryException
      Discover the metadata for a dataset given an IRI. If discovery is unsuccessful, an exception is thrown.
      Parameters:
      iri -
      Returns:
      the newly created dcat:CatalogRecord for the discovered dataset
      Throws:
      ProjectAccessException
      DeniedOperationException
      it.uniroma2.art.semanticturkey.mdr.core.MetadataDiscoveryException
    • findDatasetForProjects

      @STServiceOperation public Map<String,AnnotatedValue<org.eclipse.rdf4j.model.IRI>> findDatasetForProjects(List<Project> projects)
      Returns the datasets associated with the given projects, if any.
      Parameters:
      projects -
      Returns:
    • findProjectForDatasets

      @STServiceOperation public Map<org.eclipse.rdf4j.model.IRI,String> findProjectForDatasets(List<org.eclipse.rdf4j.model.IRI> datasets, @Optional boolean allowSubset)
      Returns the datasets associated with the given projects, if any.
      Parameters:
      datasets -
      allowSubset -
      Returns:
    • getClassPartitions

      @STServiceOperation @PreAuthorize("@auth.isAuthorized(\'sys(metadataRegistry)\', \'R\')") public Map<String,Integer> getClassPartitions(org.eclipse.rdf4j.model.IRI dataset)