public void TestMapDefaults() { var map = new SparqlMap("dbpedia.metadata", "http://dbpedia.org/ontology/", NameMapping.UpperCamelCase, "http://dbpedia.org/property/", NameMapping.LowerCamelCase); Assert.AreEqual("http://www.w3.org/2002/07/owl#Thing", map.GetUriForType("DBPedia.Thing")); Assert.AreEqual("http://dbpedia.org/ontology/Work", map.GetUriForType("DBPedia.Work")); Assert.AreEqual("http://dbpedia.org/ontology/Film", map.GetUriForType("DBPedia.Film")); Assert.AreEqual("http://dbpedia.org/ontology/Place", map.GetUriForType("DBPedia.Place")); Assert.AreEqual("http://dbpedia.org/property/elevation", map.GetUriForProperty("DBPedia.Place", "Elevation")); Assert.AreEqual("http://dbpedia.org/property/annualTemperature", map.GetUriForProperty("DBPedia.Place", "AnnualTemperature")); }
public void TestReadPropertyUriAnnotation() { var map = new SparqlMap("dbpedia.metadata", "http://dbpedia.org/ontology/", NameMapping.Unchanged, "http://dbpedia.org/property/name", NameMapping.LowerCamelCase); Assert.AreEqual("http://dbpedia.org/property/name", map.GetUriForProperty("DBPedia.Film", "Name")); }
public void TestIdPropertyMapping() { var map = new SparqlMap("dbpedia.metadata", "http://dbpedia.org/ontology/", NameMapping.UpperCamelCase, "http://dbpedia.org/property/", NameMapping.LowerCase); Assert.IsNull(map.GetUriForProperty("DBPedia.Thing", "Id")); Assert.IsNull(map.GetUriForProperty("DBPedia.Film", "Id")); Assert.IsFalse(map.GetStructuralPropertyMappings("DBPedia.Thing").Any(m => m.Name.Equals("Id"))); Assert.IsFalse(map.GetStructuralPropertyMappings("DBPedia.Film").Any(m => m.Name.Equals("Id"))); var idMapping = map.GetIdentifierPropertyMapping("DBPedia.Thing"); Assert.IsNotNull(idMapping); Assert.AreEqual("http://dbpedia.org/resource/", idMapping.IdentifierPrefix); Assert.AreEqual("Id", idMapping.Name); idMapping = map.GetIdentifierPropertyMapping("DBPedia.Film"); Assert.IsNotNull(idMapping); Assert.AreEqual("http://dbpedia.org/resource/", idMapping.IdentifierPrefix); Assert.AreEqual("Id", idMapping.Name); }
public void TestIdPropertyMapping() { var map = new SparqlMap("dbpedia.metadata", "http://dbpedia.org/ontology/", NameMapping.UpperCamelCase, "http://dbpedia.org/property/", NameMapping.LowerCase); Assert.IsNull(map.GetUriForProperty("DBPedia.Thing", "Id")); Assert.IsNull(map.GetUriForProperty("DBPedia.Film", "Id")); Assert.IsFalse(map.GetStructuralPropertyMappings("DBPedia.Thing").Any(m => m.Name.Equals("Id"))); Assert.IsFalse(map.GetStructuralPropertyMappings("DBPedia.Film").Any(m=>m.Name.Equals("Id"))); var idMapping = map.GetIdentifierPropertyMapping("DBPedia.Thing"); Assert.IsNotNull(idMapping); Assert.AreEqual("http://dbpedia.org/resource/", idMapping.IdentifierPrefix); Assert.AreEqual("Id", idMapping.Name); idMapping = map.GetIdentifierPropertyMapping("DBPedia.Film"); Assert.IsNotNull(idMapping); Assert.AreEqual("http://dbpedia.org/resource/", idMapping.IdentifierPrefix); Assert.AreEqual("Id", idMapping.Name); }