public void TestInstanceOfQuery_InstancesOfHumans() { const string filename = "Resources/QuerySingle.nt"; const string outputPath = "QueryInstanceOf"; outputPath.DeleteIfExists(); new EntitiesIndexer(filename, outputPath).Index(); var q5Entities = new MultiIdInstanceOfEntityQuery(outputPath, "Q5").Query(); Assert.True(q5Entities.All(x => x.ParentTypes.Contains("Q5"))); outputPath.DeleteIfExists(); }
public void TestIndexHasTypes() { const string filename = "Resources/EntityTypes.nt"; const string outputPath = "IndexHasTypes"; outputPath.DeleteIfExists(); Assert.False(Directory.Exists(outputPath)); new EntitiesIndexer(filename, outputPath).Index(); var typesQuery = new MultiIdInstanceOfEntityQuery(outputPath, "Q5").Query(); Assert.NotEmpty(typesQuery); Assert.All(typesQuery, x => x.ParentTypes.Equals("Q5")); outputPath.DeleteIfExists(); }