-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hello,
I would to have like your opinion on the following:
1- I am using RomanticWeb to create Entities
2- Serializing the entities in an RDF/XML using DotNetRDF
IGraph g = new Graph();
IList graphList = store().Graphs.ToList();
foreach (IGraph currentGraph in graphList) { g.Merge(currentGraph); }
RdfXmlWriter rdfXmlWriter = new RdfXmlWriter();
rdfXmlWriter.Save(g, fileName);3- I am taking the RDF/XML file and insert it manually in Stardog.
4- After insertion, I am relying on RomanticWeb to load some entities as following:
IFloor as1 = context.Load<IFloor>(new Uri(nameSpace + "#11-UNIQ-ID"));
Console.WriteLine(as1.Hasname);However, I can't retrieve any IEntity, it seems not existent, (even if I see it well in the ontology DB browser.
It seems to work only when:
1- I configure RomanticWeb to be plugged to Stardog through the App.config.
2- I commit from RomanticWeb (context.Commit()) to Stardog,
3- I can load and manipulate all of my objects.
Off course having a direct commit is not a usual situation.
Any idea on what might be happening? Is it the serialization to RDF?
What is context.commit() doing that is different from the serialization?
I looked at the code EntityContext.cs and TripleStoreAdapter.cs, I am not sure if the commit is executed through SPARQL queries?
public void Commit(IEnumerable<DatasetChange> changes)
{
var updateCommands = changes.SelectMany(CreateCommands);
var commands = new SparqlUpdateCommandSet(updateCommands);
LogTo.Debug("Executing SPARQL Update:{0}{1}", Environment.NewLine, commands);
ExecuteCommandSet(commands);
}Any ideas how to make it compatible with the load (rdf) files.
I am also having this kind of errors sometimes when I am using LINQ queries:
IQueryable<IFloor> typedQuery = from entity in context.AsQueryable<IFloor>()
select entity;
foreach (IFloor ent in typedQuery)
{
Console.WriteLine("- " + ent.Hasname);
}
Console.WriteLine("End of results");
Console.ReadLine();RomanticWeb.Entities.CardinalityException occurred
HResult=0x80131500
Message=Exception of type 'RomanticWeb.Entities.CardinalityException' was thrown.
Source=RomanticWeb
StackTrace:
at RomanticWeb.Entities.ResultAggregations.SingleOrDefault.Aggregate(IEnumerable`1 objects) in S:\TeamCity\buildAgent\work\b59ad31af090d0d3\RomanticWeb\Entities\ResultAggregations\SingleOrDefault.cs:line 25
at RomanticWeb.Entities.ResultPostprocessing.SimpleTransformer.FromNodes(IEntityProxy parent, IPropertyMapping property, IEntityContext context, IEnumerable`1 nodes) in S:\TeamCity\buildAgent\work\b59ad31af090d0d3\RomanticWeb\Entities\ResultPostprocessing\SimpleTransformer.cs:line 34
at RomanticWeb.Entities.EntityProxy.TryGetMember(GetMemberBinder binder, Object& result) in S:\TeamCity\buildAgent\work\b59ad31af090d0d3\RomanticWeb\Entities\EntityProxy.cs:line 118
at RomanticWeb.Entities.Proxies.DynamicExtensions.InvokeGet(Object target, String propertyName) in S:\TeamCity\buildAgent\work\b59ad31af090d0d3\RomanticWeb\Entities\Proxies\DynamicExtensions.cs:line 82
at ProxyOf_34347631_Hash.get_Hasname()
at REMI.Program.Main(String[] args) in \REMI\Program.cs:line 43
Ideally, I would like to take a rdf file generated by RomanticWeb and DotNetRDF and loaded in an ontology DB. Then, query the db with RomanticWeb though the context.Load.
Thank you for your help,
Charbel