https://github.com/niklr/rdfstorenet
A .NET library for the Open Physiology Rdfstore API
https://github.com/niklr/rdfstorenet
Last synced: about 2 months ago
JSON representation
A .NET library for the Open Physiology Rdfstore API
- Host: GitHub
- URL: https://github.com/niklr/rdfstorenet
- Owner: niklr
- License: mit
- Created: 2016-04-19T14:32:53.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-02T12:05:00.000Z (about 10 years ago)
- Last Synced: 2025-01-17T10:25:02.986Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
RdfstoreNet
=========
RdfstoreNet is a .NET library for interacting with the Rdfstore API developed and maintained by Open Physiology. Rdfstore API is a metadata wrapper based on templates serving as a messenger between SPARQL endpoint and end-user, obviating the need to learn complicated SPARQL syntax. The RdfstoreNet library is mainly comprised of "endpoint" and "model" classes. Each endpoint class aligns itself with a subject in the Rdfstore API (e.g. templates, triples, etc.), while model classes are strongly-typed representations of the data flow to and from these endpoints. Each endpoint implements one or more operations that affect the associated models (retrieval, creation, deletion). For the sake of flexibility, these operations are available in synchronous and asynchronous flavors.
### Dependencies:
* [RestSharp](http://restsharp.org/)
* [Moq](http://code.google.com/p/moq/)
For full documentation of the Open Physiology Rdfstore API, visit http://open-physiology.org/rdfstore/doc.html
The Open Physiology Rdfstore API is open source as well https://github.com/open-physiology/rdfstore
## Examples
### Create triple using the triple endpoint
```csharp
var triple = new TripleModel()
{
Subject = "http://virtualskeleton.ch/api/objects/1",
Predicate = "http://virtualskeleton.ch/ont/predicates/has_anatomical_region",
Object = "http://purl.obolibrary.org/obo/FMA_11089"
};
var tripleEndpoint = new TripleEndpoint(accessManager);
tripleEndpoint.CreateTriple(triple);
```
### Create triple using the template endpoint
```csharp
string templateName = "Insert_Triple_(Fuseki)";
var triple = new TripleModel()
{
Subject = "http://virtualskeleton.ch/api/objects/1",
Predicate = "http://virtualskeleton.ch/ont/predicates/has_anatomical_region",
Object = "http://purl.obolibrary.org/obo/FMA_11089"
};
var templateEndpoint = new TemplateEndpoint(accessManager);
templateEndpoint.CallTemplate(templateName, triple.Subject, triple.Predicate, triple.Object);
```
### Get resources
```csharp
string templateName = "Get_Resources";
var templateEndpoint = new TemplateEndpoint(accessManager);
var response = templateEndpoint.CallTemplate(templateName);
```