Example #1
0
        private IGraph getExistingGraph(Uri subject, Dictionary <string, INode> graphRetrievalDictionary, T settings)
        {
            graphRetrievalDictionary = graphRetrievalDictionary ?? new Dictionary <string, INode>();
            graphRetrievalDictionary.Add("subject", SparqlConstructor.GetNode(subject));
            SparqlConstructor sparqlConstructor = new SparqlConstructor(settings.ExistingGraphSparqlCommand, graphRetrievalDictionary);

            sparqlConstructor.Sparql.Namespaces.AddNamespace("parl", new Uri(schemaNamespace));
            logger.Verbose("Trying to get existing graph");
            return(GraphRetrieval.GetGraph(sparqlConstructor.Sparql.ToString(), logger));
        }
        public override Dictionary <string, INode> GetKeysFromSource(BaseResource[] deserializedSource)
        {
            string contactPointMnisId = deserializedSource.OfType <MnisContactPoint>()
                                        .SingleOrDefault()
                                        .ContactPointMnisId;

            return(new Dictionary <string, INode>()
            {
                { "contactPointMnisId", SparqlConstructor.GetNode(contactPointMnisId) }
            });
        }
Example #3
0
        private Uri getSubject(Dictionary <string, INode> subjectRetrievalDictionary, T settings)
        {
            Uri subjectUri = null;

            try
            {
                logger.Verbose("Getting key");
                SparqlConstructor sparqlConstructor = new SparqlConstructor(settings.SubjectRetrievalSparqlCommand, subjectRetrievalDictionary);
                sparqlConstructor.Sparql.Namespaces.AddNamespace("parl", new Uri(schemaNamespace));
                subjectUri = IdRetrieval.GetSubject(sparqlConstructor.Sparql.ToString(), true, logger);
                logger.Verbose($"Subject: {subjectUri}");
            }
            catch (Exception e)
            {
                logger.Exception(e);
            }
            return(subjectUri);
        }