Skip to content

Commit 595f81e

Browse files
committed
integrated vocab generating from rdf mapper annotations/generator
1 parent df8a0de commit 595f81e

18 files changed

Lines changed: 1103 additions & 214 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"lockFileVersion": 1,
3+
"types": {
4+
"minimal_task_sync/lib/task.dart#Task": {
5+
"classIri": "https://locorda.dev/example/minimal/vocab#Task",
6+
"properties": {
7+
"completed": {
8+
"iri": "https://locorda.dev/example/minimal/vocab#completed",
9+
"source": "auto"
10+
},
11+
"createdAt": {
12+
"iri": "https://locorda.dev/example/minimal/vocab#createdAt",
13+
"source": "auto"
14+
},
15+
"title": {
16+
"iri": "http://purl.org/dc/terms/title",
17+
"source": "auto"
18+
}
19+
}
20+
}
21+
}
22+
}

packages/locorda/example/minimal/lib/locorda_config.g.dart

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/locorda/example/minimal/lib/src/generated/mapping_bootstrap.g.dart

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/locorda/example/minimal/lib/task.dart

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,23 @@ library;
33

44
import 'package:locorda_annotations/locorda_annotations.dart';
55
import 'package:locorda_rdf_mapper_annotations/annotations.dart';
6-
import 'package:locorda_rdf_core/core.dart';
7-
import 'package:locorda_rdf_terms_schema/schema.dart';
86
import 'package:minimal_task_sync/consts.dart' show appBaseUrl;
97

108
// #docregion task-model
119
/// A simple task with CRDT sync.
12-
@RootResource(
13-
IriTerm('$appBaseUrl/vocabulary/task#Task'),
14-
MergeContract('$appBaseUrl/mappings/task-v1#'),
15-
)
10+
@RootResource(AppVocab(appBaseUri: appBaseUrl))
1611
class Task {
1712
/// Unique ID for this task
1813
@RdfIriPart()
1914
final String id;
2015

21-
/// Task title - LWW (Last Writer Wins)
22-
@RdfProperty(SchemaCreativeWork.name)
16+
/// Task title - LWW (Last Writer Wins) is the default merge strategy
2317
final String title;
2418

25-
/// Completion status - LWW (schema.org has no boolean completion property)
26-
@RdfProperty(IriTerm('$appBaseUrl/vocabulary/task#completed'))
19+
/// Completion status
2720
final bool completed;
2821

29-
/// Creation timestamp - Immutable
30-
@RdfProperty(SchemaCreativeWork.dateCreated)
31-
@CrdtImmutable()
22+
/// Creation timestamp
3223
final DateTime createdAt;
3324

3425
Task({

packages/locorda/example/minimal/lib/task.rdf_mapper.g.dart

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@prefix minimal: <https://locorda.dev/example/minimal/vocab#> .
2+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
3+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
4+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
5+
6+
<https://locorda.dev/example/minimal/vocab#> a owl:Ontology .
7+
8+
minimal:Task a owl:Class;
9+
rdfs:isDefinedBy minimal:;
10+
rdfs:label "Task";
11+
rdfs:subClassOf owl:Thing .
12+
13+
minimal:completed a rdf:Property;
14+
rdfs:domain minimal:Task;
15+
rdfs:isDefinedBy minimal:;
16+
rdfs:label "Completed" .
17+
18+
minimal:createdAt a rdf:Property;
19+
rdfs:domain minimal:Task;
20+
rdfs:isDefinedBy minimal:;
21+
rdfs:label "Created At" .

0 commit comments

Comments
 (0)