Exemplo n.º 1
0
        public string GetOntologyHash()
        {
            string ontology = OntologyService.GetOntology();

            using (SHA256 sha256Hash = SHA256.Create())
            {
                string hash = GetHash(sha256Hash, ontology);
                return(hash);
            }
        }
Exemplo n.º 2
0
 public IActionResult dataValidate(IFormFile rdfFile, Guid repositoryIdentifier)
 {
     try
     {
         string   rdfFileContent = SparqlUtility.GetTextFromFile(rdfFile);
         RohGraph ontologyGraph  = new RohGraph();
         ontologyGraph.LoadFromString(OntologyService.GetOntology());
         return(Ok(SparqlUtility.ValidateRDF(rdfFileContent, _shapeConfigService.GetShapesConfigs().FindAll(x => x.RepositoryID == repositoryIdentifier), ontologyGraph)));
     }
     catch (Exception ex)
     {
         return(Problem(ex.ToString()));
     }
 }
Exemplo n.º 3
0
 public IActionResult LoadOntology(IFormFile ontology)
 {
     try
     {
         OntologyService.SetOntology(ontology);
         string ontologyGraph = "";
         ontologyGraph = _configSparql.GetGraphRoh();
         RohGraph graph = new RohGraph();
         graph.LoadFromString(OntologyService.GetOntology());
         SparqlUtility.LoadOntology(graph, _configSparql.GetEndpoint(), _configSparql.GetQueryParam(), ontologyGraph);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(Problem(ex.ToString()));
     }
 }
Exemplo n.º 4
0
 public IActionResult GetOntology()
 {
     return(Ok(OntologyService.GetOntology()));
 }