diff --git a/src/SQL2Linked/Implementations/UserStructuralData.cs b/src/SQL2Linked/Implementations/UserStructuralData.cs index 29f811134e4aca5bf73595e276555698fa2ed524..59a6999999e5f24a7a89cb95e2c6c866c10880b4 100644 --- a/src/SQL2Linked/Implementations/UserStructuralData.cs +++ b/src/SQL2Linked/Implementations/UserStructuralData.cs @@ -11,6 +11,12 @@ namespace SQL2Linked.Implementations public readonly Uri rdf = new("http://www.w3.org/1999/02/22-rdf-syntax-ns#"); public readonly Uri foaf = new("http://xmlns.com/foaf/0.1/"); + // Override to only transform users which have accepted the TOS + public override IEnumerable<User> GetAll() + { + return Model.GetAllWhere((user) => user.Tosaccepteds.Any()); + } + public override IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<User> entries) { var graphs = new List<IGraph>(); diff --git a/src/SQL2Linked/StructuralData.cs b/src/SQL2Linked/StructuralData.cs index 4d2e231cd558ffd42b71463673b1b671e4a49fc3..9f9f113569964718b67b037da6c7cc0a856c485c 100644 --- a/src/SQL2Linked/StructuralData.cs +++ b/src/SQL2Linked/StructuralData.cs @@ -25,11 +25,16 @@ namespace SQL2Linked public abstract IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<S> entries); + public virtual IEnumerable<S> GetAll() + { + return Model.GetAll(); + } + public void Migrate(bool dummyMode) { var spacer = new string('-', 35); Console.WriteLine($"\n{spacer}\n{typeof(T).Name}\n{spacer}"); - var graphs = ConvertToLinkedData(Model.GetAll()); + var graphs = ConvertToLinkedData(GetAll()); if (!dummyMode) { StoreGraphs(graphs); @@ -56,6 +61,7 @@ namespace SQL2Linked Console.WriteLine(); } } + public void AssertToGraphUriNode(IGraph graph, string graphSubject, string graphPredicate, string graphObject) { graph.Assert( @@ -66,6 +72,7 @@ namespace SQL2Linked ) ); } + public void AssertToGraphLiteralNode(IGraph graph, string graphSubject, string graphPredicate, string graphObject, Uri? objectType = null) { graph.Assert(