Permalink
Browse files

Done

  • Loading branch information...
1 parent 8f655e4 commit 38994eb8d86ee2779d1f52e5d48cb93f058b7e99 @kwende kwende committed Apr 17, 2017
File renamed without changes.
@@ -18,7 +18,7 @@ private static void PrintAnnotations(AnnotationResult[] annotationResults)
Console.WriteLine("Class details");
Console.WriteLine("\tID: " + annotationPage.ID);
Console.WriteLine("\tPrefLabel: " + annotationPage.PrefLabel);
- Console.WriteLine("\tOntology: " + annotationPage.Links.Ontology);
+ Console.WriteLine("\tOntology: " + annotationPage.Links?.Ontology);
Console.WriteLine("Annotation details");
foreach(Annotation annotation in annotationResult.Annotations)
File renamed without changes.
File renamed without changes.
@@ -7,6 +7,8 @@ namespace ncbo.DataTypes
{
public class Ontology
{
+ [JsonProperty("@id")]
+ public string ID { get; set; }
[JsonProperty("administeredBy")]
public string[] AdministeredBy { get; set; }
[JsonProperty("acronym")]
File renamed without changes.
@@ -0,0 +1,39 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ncbo.DataTypes
+{
+ public class ResourceContext
+ {
+ [JsonProperty("submissions")]
+ public string Submissions { get; set; }
+ [JsonProperty("notes")]
+ public string Notes { get; set; }
+ [JsonProperty("categories")]
+ public string Categories { get; set; }
+ [JsonProperty("provisional_classes")]
+ public string ProvisionalClasses { get; set; }
+ [JsonProperty("slices")]
+ public string Slices { get; set; }
+ [JsonProperty("metrics")]
+ public string Metrics { get; set; }
+ [JsonProperty("mappings")]
+ public string Mappings { get; set; }
+ [JsonProperty("users")]
+ public string Users { get; set; }
+ [JsonProperty("projects")]
+ public string Projects { get; set; }
+ [JsonProperty("ontologies")]
+ public string Ontologies { get; set; }
+ [JsonProperty("groups")]
+ public string Groups { get; set; }
+ [JsonProperty("replies")]
+ public string Replies { get; set; }
+ [JsonProperty("provisional_relations")]
+ public string ProvisionalRelations { get; set; }
+ [JsonProperty("reviews")]
+ public string Reviews { get; set; }
+ }
+}
@@ -0,0 +1,59 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ncbo.DataTypes
+{
+ public class ResourceLinks
+ {
+ [JsonProperty("submissions")]
+ public string Submissions { get; set; }
+ [JsonProperty("notes")]
+ public string Notes { get; set; }
+ [JsonProperty("categories")]
+ public string Categories { get; set; }
+ [JsonProperty("provisional_classes")]
+ public string ProvisionalClasses { get; set; }
+ [JsonProperty("annotator")]
+ public string Annotator { get; set; }
+ [JsonProperty("resource_index")]
+ public string ResourceIndex { get; set; }
+ [JsonProperty("documentation")]
+ public string Documentation { get; set; }
+ [JsonProperty("slices")]
+ public string Slices { get; set; }
+ [JsonProperty("metrics")]
+ public string Metrics { get; set; }
+ [JsonProperty("mappings")]
+ public string Mappings { get; set; }
+ [JsonProperty("users")]
+ public string Users { get; set; }
+ [JsonProperty("search")]
+ public string Search { get; set; }
+ [JsonProperty("projects")]
+ public string Projects { get; set; }
+ [JsonProperty("ontologies")]
+ public string Ontologies { get; set; }
+ [JsonProperty("ccv")]
+ public string CCV { get; set; }
+ [JsonProperty("recommender")]
+ public string Recommender { get; set; }
+ [JsonProperty("groups")]
+ public string Groups { get; set; }
+ [JsonProperty("replies")]
+ public string Replies { get; set; }
+ [JsonProperty("recommender_v1")]
+ public string RecommenderV1 { get; set; }
+ [JsonProperty("provisional_relations")]
+ public string ProvisionalRelations { get; set; }
+ [JsonProperty("property_search")]
+ public string PropertySearch { get; set; }
+ [JsonProperty("analytics")]
+ public string Analytics { get; set; }
+ [JsonProperty("reviews")]
+ public string Reviews { get; set; }
+ [JsonProperty("@context")]
+ public ResourceContext Context { get; set; }
+}
+}
@@ -0,0 +1,13 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ncbo.DataTypes
+{
+ public class Resources
+ {
+ [JsonProperty("links")]
+ public ResourceLinks Links { get; set; }
+ }
+}
@@ -44,8 +44,6 @@ public static void DoIt()
{
Console.WriteLine(label);
}
-
- Console.ReadLine();
}
}
}
@@ -0,0 +1,27 @@
+using ncbo.Common;
+using ncbo.DataTypes;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Linq;
+
+namespace ncbo
+{
+ public static class ListOntologies
+ {
+ public static void DoIt()
+ {
+ Resources resources = Network.GetResponseAs<Resources>("http://data.bioontology.org");
+
+ Ontology[] ontologies = Network.GetResponseAs<Ontology[]>(resources.Links.Ontologies);
+
+ IEnumerable<string> ontologyStrings = ontologies.Select(n => n.Name + Environment.NewLine +
+ n.ID + Environment.NewLine + Environment.NewLine);
+
+ foreach(string ontologyString in ontologyStrings)
+ {
+ Console.WriteLine(ontologyString);
+ }
+ }
+ }
+}
View
@@ -0,0 +1,33 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+namespace ncbo
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Console.WriteLine("GetLabels:");
+ GetLabels.DoIt();
+
+ Console.WriteLine();
+ Console.WriteLine("AnnotateText:");
+ AnnotateText.DoIt();
+
+ Console.WriteLine();
+ Console.WriteLine("ClassesSearch");
+ ClassesSearch.DoIt();
+
+ Console.WriteLine();
+ Console.WriteLine("ListOntologies");
+ ListOntologies.DoIt();
+
+ Console.WriteLine("Done");
+ Console.ReadLine();
+ }
+ }
+}
File renamed without changes.
@@ -1,21 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net.Http;
-using System.Threading.Tasks;
-
-namespace ncbo
-{
- class Program
- {
- static void Main(string[] args)
- {
- //GetLabels.DoIt();
-
- //AnnotateText.DoIt();
-
- ClassesSearch.DoIt();
- }
- }
-}

0 comments on commit 38994eb

Please sign in to comment.