Skip to content

Commit

Permalink
Updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
meberl committed Jul 17, 2020
1 parent 77b0fb4 commit 3241571
Show file tree
Hide file tree
Showing 25 changed files with 367 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Examples/Examples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29324.140
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Asp.Net Core Example", "Asp.Net Core Example\Asp.Net Core Example.csproj", "{67A0DDF4-8EFF-48E1-9433-E592E69C0D56}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Asp.Net Core Example", "core-example\core-example.csproj", "{67A0DDF4-8EFF-48E1-9433-E592E69C0D56}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FirstSteps", "FirstSteps\FirstSteps.csproj", "{EA3998E0-44F3-43A3-A994-7A1706280759}"
EndProject
Expand Down
20 changes: 20 additions & 0 deletions Examples/core-example/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.vs
**/.vscode
**/*.*proj.user
**/azds.yaml
**/charts
**/bin
**/obj
**/Dockerfile
**/docker-compose.yml
**/docker-compose.*.yml
**/*.dbmdl
**/*.jfm
**/secrets.dev.yaml
**/values.dev.yaml
**/.toolstarget
**/node_modules/**
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ public class DataProvider

public IStore Store { get { return StoreFactory.CreateStore(_connectionString); } }

private string _connectionString = "provider=virtuoso;host=127.0.0.1;port=1111;uid=dba;pw=dba;rule=urn:example/ruleset";
#if RELEASE
private string _connectionString = "provider=virtuoso;host=store;port=1111;uid=dba;pw=dba;rule=urn:example/ruleset";
#else
private string _connectionString = "provider=virtuoso;host=store;port=1111;uid=dba;pw=dba;rule=urn:example/ruleset";
#endif
public IModel DefaultModel { get { return Store.GetModel(_defaultModelUri); } }

Uri _defaultModelUri = new Uri("http://my-default-model/");
Expand Down
18 changes: 18 additions & 0 deletions Examples/core-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY [".", "./core-example"]
WORKDIR /src/core-example
RUN dotnet publish "core-example.csproj" -v n --configuration Release -o /app
COPY wait-for-it.sh /app
COPY Ontologies /app/ontologies


FROM base AS final
COPY --from=build /app .
WORKDIR /app
ENTRYPOINT ["dotnet", "core-example.dll"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Attention: This file is generated. Any modifications will eventually be overwritten.
// Date: 11.12.2019 10:14:26
// Date: 19.03.2020 17:13:10

using System;
using System.Collections.Generic;
Expand Down
File renamed without changes.
File renamed without changes.
109 changes: 109 additions & 0 deletions Examples/core-example/Ontologies/rdfs.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;
dc:title "The RDF Schema vocabulary (RDFS)" .

rdfs:Resource a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Resource" ;
rdfs:comment "The class resource, everything." .

rdfs:Class a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Class" ;
rdfs:comment "The class of classes." ;
rdfs:subClassOf rdfs:Resource .

rdfs:subClassOf a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "subClassOf" ;
rdfs:comment "The subject is a subclass of a class." ;
rdfs:range rdfs:Class ;
rdfs:domain rdfs:Class .

rdfs:subPropertyOf a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "subPropertyOf" ;
rdfs:comment "The subject is a subproperty of a property." ;
rdfs:range rdf:Property ;
rdfs:domain rdf:Property .

rdfs:comment a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "comment" ;
rdfs:comment "A description of the subject resource." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Literal .

rdfs:label a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "label" ;
rdfs:comment "A human-readable name for the subject." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Literal .

rdfs:domain a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "domain" ;
rdfs:comment "A domain of the subject property." ;
rdfs:range rdfs:Class ;
rdfs:domain rdf:Property .

rdfs:range a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "range" ;
rdfs:comment "A range of the subject property." ;
rdfs:range rdfs:Class ;
rdfs:domain rdf:Property .

rdfs:seeAlso a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "seeAlso" ;
rdfs:comment "Further information about the subject resource." ;
rdfs:range rdfs:Resource ;
rdfs:domain rdfs:Resource .

rdfs:isDefinedBy a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:subPropertyOf rdfs:seeAlso ;
rdfs:label "isDefinedBy" ;
rdfs:comment "The defininition of the subject resource." ;
rdfs:range rdfs:Resource ;
rdfs:domain rdfs:Resource .

rdfs:Literal a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Literal" ;
rdfs:comment "The class of literal values, eg. textual strings and integers." ;
rdfs:subClassOf rdfs:Resource .

rdfs:Container a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Container" ;
rdfs:subClassOf rdfs:Resource ;
rdfs:comment "The class of RDF containers." .

rdfs:ContainerMembershipProperty a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "ContainerMembershipProperty" ;
rdfs:comment """The class of container membership properties, rdf:_1, rdf:_2, ...,
all of which are sub-properties of 'member'.""" ;
rdfs:subClassOf rdf:Property .

rdfs:member a rdf:Property ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "member" ;
rdfs:comment "A member of the subject resource." ;
rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Resource .

rdfs:Datatype a rdfs:Class ;
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
rdfs:label "Datatype" ;
rdfs:comment "The class of RDF datatypes." ;
rdfs:subClassOf rdfs:Class .

<http://www.w3.org/2000/01/rdf-schema#> rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
Expand All @@ -8,6 +7,7 @@
"sslPort": 44366
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
Expand All @@ -17,14 +17,9 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Asp.Net_Core_Example": {
"Kestrel": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"applicationUrl": "http://localhost:5050"
}
}
}
}
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions Examples/core-example/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

docker build -t core-example:latest .
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>Asp.Net_Core_Example</RootNamespace>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>CoreExample</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,9 +16,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="Semiodesk.Trinity" Version="1.0.0" />
<PackageReference Include="Semiodesk.Trinity.Virtuoso" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
<PackageReference Include="Semiodesk.Trinity" Version="1.0.3.30" />
<PackageReference Include="Semiodesk.Trinity.Virtuoso" Version="1.0.3.30" />
</ItemGroup>

<ItemGroup>
Expand Down
22 changes: 22 additions & 0 deletions Examples/core-example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.4'

services:
modom-io:
image: "core-example:latest"
ports:
- "8000:80"
- "8443:443"
depends_on:
- store
entrypoint: ["./wait-for-it.sh", "store:1111", "--", "dotnet", "core-example.dll"]

store:
image: "tenforce/virtuoso:virtuoso7.2.5"
ports:
- "8890:8890"
environment:
DBA_PASSWORD: "dba" # Change to something more secure if you want.
SPARQL_UPDATE: "true"
DEFAULT_GRAPH: "http://example.com/"
volumes:
- .\core-example-store-data:/data
File renamed without changes.
1 change: 1 addition & 0 deletions Examples/core-example/start.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-compose up
Loading

0 comments on commit 3241571

Please sign in to comment.