Abandon parser

This commit is contained in:
erik 2023-06-22 15:45:51 +02:00
parent 4bf90ae278
commit 1d6c71f56a

View file

@ -1,38 +1,38 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.parser-test ;(ns org.domaindrivenarchitecture.activity-pub-poc.parser-test
(:require [clojure.test :refer :all] ; (:require [clojure.test :refer :all]
[org.domaindrivenarchitecture.activity-pub-poc.parser :as sut])) ; [org.domaindrivenarchitecture.activity-pub-poc.parser :as sut]))
(def processed (slurp "src/test/resources/deleted_comments_minimal.ttl")) ;(def processed (slurp "src/test/resources/deleted_comments_minimal.ttl"))
(def expected-definitions ["@prefix : <http://www.w3.org/ns/activitystreams#> " ;(def expected-definitions ["@prefix : <http://www.w3.org/ns/activitystreams#> "
"@prefix as: <http://www.w3.org/ns/activitystreams#> " ; "@prefix as: <http://www.w3.org/ns/activitystreams#> "
"@prefix owl: <http://www.w3.org/2002/07/owl#> " ; "@prefix owl: <http://www.w3.org/2002/07/owl#> "
"@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " ; "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
"@prefix xml: <http://www.w3.org/XML/1998/namespace> " ; "@prefix xml: <http://www.w3.org/XML/1998/namespace> "
"@prefix xsd: <http://www.w3.org/2001/XMLSchema#> " ; "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> "
"@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> " ; "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> "
"@base <http://www.w3.org/ns/activitystreams> " ; "@base <http://www.w3.org/ns/activitystreams> "
"<http://www.w3.org/ns/activitystreams#> a owl:Ontology ;\n rdfs:comment \"Extended Activity Streams 2.0 Vocabulary\"@en ;\n rdfs:label \"Activity Streams 2.0\"@en ;\n owl:imports <http://www.w3.org/ns/prov#> " ; "<http://www.w3.org/ns/activitystreams#> a owl:Ontology ;\n rdfs:comment \"Extended Activity Streams 2.0 Vocabulary\"@en ;\n rdfs:label \"Activity Streams 2.0\"@en ;\n owl:imports <http://www.w3.org/ns/prov#> "
"rdf:langString a rdfs:Datatype " ; "rdf:langString a rdfs:Datatype "
"xsd:duration a rdfs:Datatype " ; "xsd:duration a rdfs:Datatype "
"as:actor a owl:ObjectProperty ;\n rdfs:label \"actor\"@en ;\n rdfs:domain as:Activity ;\n rdfs:comment \"Subproperty of as:attributedTo that identifies the primary actor\"@en ;\n rdfs:subPropertyOf as:attributedTo ;\n rdfs:range [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] " ; "as:actor a owl:ObjectProperty ;\n rdfs:label \"actor\"@en ;\n rdfs:domain as:Activity ;\n rdfs:comment \"Subproperty of as:attributedTo that identifies the primary actor\"@en ;\n rdfs:subPropertyOf as:attributedTo ;\n rdfs:range [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] "
"as:attributedTo a owl:ObjectProperty ;\n rdfs:label \"attributedTo\"@en;\n rdfs:comment \"Identifies an entity to which an object is attributed\"@en;\n rdfs:range [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] ;\n rdfs:domain [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] ; "]) ; "as:attributedTo a owl:ObjectProperty ;\n rdfs:label \"attributedTo\"@en;\n rdfs:comment \"Identifies an entity to which an object is attributed\"@en;\n rdfs:range [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] ;\n rdfs:domain [\n a owl:Class ;\n owl:unionOf (as:Object as:Link)\n ] ; "])
;
(deftest remove-comments-test ;(deftest remove-comments-test
(is ; (is
(= processed ; (= processed
(sut/delete-comments-and-newlines "src/test/resources/minimal.ttl")))) ; (sut/delete-comments-and-newlines "src/test/resources/minimal.ttl"))))
;
((deftest find-definitions-test ;((deftest find-definitions-test
(testing "Finding definitons" ; (testing "Finding definitons"
(is (= expected-definitions ; (is (= expected-definitions
(sut/find-definitions processed)))))) ; (sut/find-definitions processed))))))
;
;ToDo ;;ToDo
; spec für eine property: as:name ;; spec für eine property: as:name
; test für (defn get-spec-from-ttl ttl-file element-name [spezified predicates]) -> (str spec) ;; test für (defn get-spec-from-ttl ttl-file element-name [spezified predicates]) -> (str spec)
;
; ToDo ;; ToDo
; spec generator ;; spec generator
;
; das gleiche für as:actor ;; das gleiche für as:actor