Hi, I would like to know how to change the code below so I can in the result both the instance and class it belongs to? I have to change the query to have these two values in the result rows? Currently I only get the entity name in the result.
SemanticAnnotation.SemanticAnnotationAPIClient semami = new SemanticAnnotation.SemanticAnnotationAPIClient(); SemanticAnnotation.KIMAnnotation[] kimASet=semami.executeText(text, 0, "<NULL>"); IEnumerator iterator = kimASet.GetEnumerator(); while (iterator.MoveNext()) { SemanticAnnotation.KIMAnnotation kima = (SemanticAnnotation.KIMAnnotation)iterator.Current; SemanticAnnotation.Feature[] kimfea = kima.Features; if (kimfea != null) { string resourceUri = GetFeatureInstance(kimfea);//kimFeatures.get(FeatureConstants.INSTANCE); Resource uriRes = null; if (resourceUri.StartsWith("_")) uriRes = new BNodeImpl(resourceUri); else uriRes = new URIImpl(resourceUri); SemanticRepository.SemanticQueryResult properties = (new SemanticRepository.SemanticRepositoryAPIClient()) .evaluateSelectSeRQL("select distinct MainLabel " + "from {<" + uriRes.ToString() + ">} <" + URIImpl.RDFS_LABEL.getURI() + "> {MainLabel}"); //count entities and fill a map with number and names foreach (SemanticRepository.SemanticQueryResultRow row in properties.Rows) { string v=row.Values[0]; //System.Console.WriteLine(row.Values[0]); if (result[v] == null) { result[v] = v; } } } } Cheers, Anton
_______________________________________________ Kim-discussion mailing list Kim-discussion@ontotext.com http://ontotext.com/mailman/listinfo/kim-discussion