rdf4j-python 0.1.1a0__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ CONFIG = Namespace("tag:rdf4j.org,2023:config/")
9
9
 
10
10
  class RepositoryConfig:
11
11
  """
12
- Represents the configuration for an RDF4J Repository using RDFlib.
12
+ Represents the configuration for an RDF4J Repository.
13
13
  """
14
14
 
15
15
  _repo_id: str
@@ -22,21 +22,49 @@ class RepositoryConfig:
22
22
  title: Optional[str] = None,
23
23
  impl: Optional["RepositoryImplConfig"] = None,
24
24
  ):
25
+ """
26
+ Initializes a new RepositoryConfig instance.
27
+
28
+ Args:
29
+ repo_id (str): The unique identifier for the repository.
30
+ title (Optional[str], optional): A human-readable title for the repository. Defaults to None.
31
+ impl (Optional[RepositoryImplConfig], optional): The implementation configuration for the repository. Defaults to None.
32
+ """
25
33
  self._repo_id = repo_id
26
34
  self._title = title
27
35
  self._impl = impl
28
36
 
29
37
  @property
30
38
  def repo_id(self) -> str:
39
+ """
40
+ Returns the repository ID.
41
+
42
+ Returns:
43
+ str: The repository ID.
44
+ """
31
45
  return self._repo_id
32
46
 
33
47
  @property
34
48
  def title(self) -> Optional[str]:
49
+ """
50
+ Returns the human-readable title for the repository.
51
+
52
+ Returns:
53
+ Optional[str]: The human-readable title for the repository, or None if not set.
54
+ """
35
55
  return self._title
36
56
 
37
57
  def to_turtle(self) -> str:
38
58
  """
39
59
  Serializes the Repository configuration to Turtle syntax using RDFlib.
60
+
61
+ Returns:
62
+ str: A UTF-8 encoded Turtle string representing the RDF4J repository configuration.
63
+ The serialization includes the repository ID, optional human-readable title,
64
+ and nested repository implementation configuration if available.
65
+
66
+ Raises:
67
+ ValueError: If any of the configuration values are of unsupported types during serialization.
40
68
  """
41
69
  graph = Graph()
42
70
  graph.bind("rdfs", RDFS)
@@ -56,26 +84,18 @@ class RepositoryConfig:
56
84
 
57
85
  return graph.serialize(format="turtle").encode("utf-8")
58
86
 
59
- @staticmethod
60
- def builder_with_sail_repository(
61
- sail_impl: "SailConfig",
62
- ) -> "RepositoryConfig.Builder":
63
- """
64
- Convenience method to create a RepositoryConfig with a SailRepositoryConfig.
65
- """
66
-
67
- repo_config = RepositoryConfig.Builder().repo_impl(
68
- SailRepositoryConfig.Builder().sail_impl(sail_impl).build()
69
- )
70
-
71
- return repo_config
72
-
73
87
  class Builder:
74
88
  """
75
- Builder class for creating RepositoryConfig instances.
89
+ Builder for creating RepositoryConfig instances.
76
90
  """
77
91
 
78
92
  def __init__(self, repo_id: Optional[str] = None):
93
+ """
94
+ Initializes a new RepositoryConfig.Builder instance.
95
+
96
+ Args:
97
+ repo_id (Optional[str], optional): The unique identifier for the repository. Defaults to None.
98
+ """
79
99
  self._repo_id = repo_id
80
100
  self._title: Optional[str] = None
81
101
  self._impl: Optional["RepositoryImplConfig"] = None
@@ -83,6 +103,12 @@ class RepositoryConfig:
83
103
  def repo_id(self, repo_id: str) -> "RepositoryConfig.Builder":
84
104
  """
85
105
  Sets the repository ID.
106
+
107
+ Args:
108
+ repo_id (str): The unique identifier for the repository.
109
+
110
+ Returns:
111
+ RepositoryConfig.Builder: The builder instance.
86
112
  """
87
113
  self._repo_id = repo_id
88
114
  return self
@@ -90,6 +116,12 @@ class RepositoryConfig:
90
116
  def title(self, title: str) -> "RepositoryConfig.Builder":
91
117
  """
92
118
  Sets the human-readable title for the repository.
119
+
120
+ Args:
121
+ title (str): The human-readable title for the repository.
122
+
123
+ Returns:
124
+ RepositoryConfig.Builder: The builder instance.
93
125
  """
94
126
  self._title = title
95
127
  return self
@@ -97,13 +129,37 @@ class RepositoryConfig:
97
129
  def repo_impl(self, impl: "RepositoryImplConfig") -> "RepositoryConfig.Builder":
98
130
  """
99
131
  Sets the repository implementation configuration.
132
+
133
+ Args:
134
+ impl (RepositoryImplConfig): The implementation configuration for the repository.
135
+
136
+ Returns:
137
+ RepositoryConfig.Builder: The builder instance.
100
138
  """
101
139
  self._impl = impl
102
140
  return self
103
141
 
142
+ def sail_repository_impl(
143
+ self, sail_impl: "SailConfig"
144
+ ) -> "RepositoryConfig.Builder":
145
+ """
146
+ Sets the repository implementation configuration to a SailRepositoryConfig.
147
+
148
+ Args:
149
+ sail_impl (SailConfig): The Sail configuration for the repository.
150
+
151
+ Returns:
152
+ RepositoryConfig.Builder: The builder instance.
153
+ """
154
+ self.repo_impl(SailRepositoryConfig.Builder().sail_impl(sail_impl).build())
155
+ return self
156
+
104
157
  def build(self) -> "RepositoryConfig":
105
158
  """
106
159
  Builds and returns the RepositoryConfig instance.
160
+
161
+ Returns:
162
+ RepositoryConfig: The constructed RepositoryConfig instance.
107
163
  """
108
164
  return RepositoryConfig(
109
165
  repo_id=self._repo_id, title=self._title, impl=self._impl
@@ -162,6 +218,13 @@ class SPARQLRepositoryConfig(RepositoryImplConfig):
162
218
  TYPE = "openrdf:SPARQLRepository"
163
219
 
164
220
  def __init__(self, query_endpoint: str, update_endpoint: Optional[str] = None):
221
+ """
222
+ Initializes a new SPARQLRepositoryConfig instance.
223
+
224
+ Args:
225
+ query_endpoint (str): The SPARQL query endpoint URL.
226
+ update_endpoint (Optional[str], optional): The SPARQL update endpoint URL. Defaults to None.
227
+ """
165
228
  super().__init__(rep_type=SPARQLRepositoryConfig.TYPE)
166
229
  self.config_params["sparql.queryEndpoint"] = query_endpoint
167
230
  if update_endpoint:
@@ -169,12 +232,27 @@ class SPARQLRepositoryConfig(RepositoryImplConfig):
169
232
 
170
233
  class Builder:
171
234
  def __init__(self, query_endpoint: str):
235
+ """
236
+ Initializes a new SPARQLRepositoryConfig.Builder instance.
237
+
238
+ Args:
239
+ query_endpoint (str): The SPARQL query endpoint URL.
240
+ """
172
241
  self._query_endpoint = query_endpoint
173
242
  self._update_endpoint: Optional[str] = None
174
243
 
175
244
  def update_endpoint(
176
245
  self, update_endpoint: str
177
246
  ) -> "SPARQLRepositoryConfig.Builder":
247
+ """
248
+ Sets the SPARQL update endpoint URL.
249
+
250
+ Args:
251
+ update_endpoint (str): The SPARQL update endpoint URL.
252
+
253
+ Returns:
254
+ SPARQLRepositoryConfig.Builder: The builder instance.
255
+ """
178
256
  self._update_endpoint = update_endpoint
179
257
  return self
180
258
 
@@ -209,10 +287,28 @@ class HTTPRepositoryConfig(RepositoryImplConfig):
209
287
  self._password: Optional[str] = None
210
288
 
211
289
  def username(self, username: str) -> "HTTPRepositoryConfig.Builder":
290
+ """
291
+ Sets the username for the HTTP repository.
292
+
293
+ Args:
294
+ username (str): The username for the HTTP repository.
295
+
296
+ Returns:
297
+ HTTPRepositoryConfig.Builder: The builder instance.
298
+ """
212
299
  self._username = username
213
300
  return self
214
301
 
215
302
  def password(self, password: str) -> "HTTPRepositoryConfig.Builder":
303
+ """
304
+ Sets the password for the HTTP repository.
305
+
306
+ Args:
307
+ password (str): The password for the HTTP repository.
308
+
309
+ Returns:
310
+ HTTPRepositoryConfig.Builder: The builder instance.
311
+ """
216
312
  self._password = password
217
313
  return self
218
314
 
@@ -244,10 +340,25 @@ class SailRepositoryConfig(RepositoryImplConfig):
244
340
  self._sail_impl = sail_impl
245
341
 
246
342
  def sail_impl(self, sail_impl: "SailConfig") -> "SailRepositoryConfig.Builder":
343
+ """
344
+ Sets the Sail configuration for the repository.
345
+
346
+ Args:
347
+ sail_impl (SailConfig): The Sail configuration for the repository.
348
+
349
+ Returns:
350
+ SailRepositoryConfig.Builder: The builder instance.
351
+ """
247
352
  self._sail_impl = sail_impl
248
353
  return self
249
354
 
250
355
  def build(self) -> "SailRepositoryConfig":
356
+ """
357
+ Builds and returns the SailRepositoryConfig instance.
358
+
359
+ Returns:
360
+ SailRepositoryConfig: The constructed SailRepositoryConfig instance.
361
+ """
251
362
  return SailRepositoryConfig(sail_impl=self._sail_impl)
252
363
 
253
364
 
@@ -366,22 +477,58 @@ class MemoryStoreConfig(SailConfig):
366
477
  self._default_query_evaluation_mode: Optional[str] = None
367
478
 
368
479
  def persist(self, persist: bool) -> "MemoryStoreConfig.Builder":
480
+ """
481
+ Sets the persist flag for the MemoryStore configuration.
482
+
483
+ Args:
484
+ persist (bool): The persist flag for the MemoryStore configuration.
485
+
486
+ Returns:
487
+ MemoryStoreConfig.Builder: The builder instance.
488
+ """
369
489
  self._persist = persist
370
490
  return self
371
491
 
372
492
  def sync_delay(self, sync_delay: int) -> "MemoryStoreConfig.Builder":
493
+ """
494
+ Sets the sync delay for the MemoryStore configuration.
495
+
496
+ Args:
497
+ sync_delay (int): The sync delay for the MemoryStore configuration.
498
+
499
+ Returns:
500
+ MemoryStoreConfig.Builder: The builder instance.
501
+ """
373
502
  self._sync_delay = sync_delay
374
503
  return self
375
504
 
376
505
  def iteration_cache_sync_threshold(
377
506
  self, threshold: int
378
507
  ) -> "MemoryStoreConfig.Builder":
508
+ """
509
+ Sets the iteration cache sync threshold for the MemoryStore configuration.
510
+
511
+ Args:
512
+ threshold (int): The iteration cache sync threshold for the MemoryStore configuration.
513
+
514
+ Returns:
515
+ MemoryStoreConfig.Builder: The builder instance.
516
+ """
379
517
  self._iteration_cache_sync_threshold = threshold
380
518
  return self
381
519
 
382
520
  def default_query_evaluation_mode(
383
521
  self, mode: str
384
522
  ) -> "MemoryStoreConfig.Builder":
523
+ """
524
+ Sets the default query evaluation mode for the MemoryStore configuration.
525
+
526
+ Args:
527
+ mode (str): The default query evaluation mode for the MemoryStore configuration.
528
+
529
+ Returns:
530
+ MemoryStoreConfig.Builder: The builder instance.
531
+ """
385
532
  self._default_query_evaluation_mode = mode
386
533
  return self
387
534
 
@@ -442,38 +589,110 @@ class NativeStoreConfig(SailConfig):
442
589
  self._default_query_evaluation_mode: Optional[str] = None
443
590
 
444
591
  def triple_indexes(self, indexes: str) -> "NativeStoreConfig.Builder":
592
+ """
593
+ Sets the triple indexes for the NativeStore configuration.
594
+
595
+ Args:
596
+ indexes (str): The triple indexes for the NativeStore configuration.
597
+
598
+ Returns:
599
+ NativeStoreConfig.Builder: The builder instance.
600
+ """
445
601
  self._triple_indexes = indexes
446
602
  return self
447
603
 
448
604
  def force_sync(self, sync: bool) -> "NativeStoreConfig.Builder":
605
+ """
606
+ Sets the force sync flag for the NativeStore configuration.
607
+
608
+ Args:
609
+ sync (bool): The force sync flag for the NativeStore configuration.
610
+
611
+ Returns:
612
+ NativeStoreConfig.Builder: The builder instance.
613
+ """
449
614
  self._force_sync = sync
450
615
  return self
451
616
 
452
617
  def value_cache_size(self, size: int) -> "NativeStoreConfig.Builder":
618
+ """
619
+ Sets the value cache size for the NativeStore configuration.
620
+
621
+ Args:
622
+ size (int): The value cache size for the NativeStore configuration.
623
+
624
+ Returns:
625
+ NativeStoreConfig.Builder: The builder instance.
626
+ """
453
627
  self._value_cache_size = size
454
628
  return self
455
629
 
456
630
  def value_id_cache_size(self, size: int) -> "NativeStoreConfig.Builder":
631
+ """
632
+ Sets the value ID cache size for the NativeStore configuration.
633
+
634
+ Args:
635
+ size (int): The value ID cache size for the NativeStore configuration.
636
+
637
+ Returns:
638
+ NativeStoreConfig.Builder: The builder instance.
639
+ """
457
640
  self._value_id_cache_size = size
458
641
  return self
459
642
 
460
643
  def namespace_cache_size(self, size: int) -> "NativeStoreConfig.Builder":
644
+ """
645
+ Sets the namespace cache size for the NativeStore configuration.
646
+
647
+ Args:
648
+ size (int): The namespace cache size for the NativeStore configuration.
649
+
650
+ Returns:
651
+ NativeStoreConfig.Builder: The builder instance.
652
+ """
461
653
  self._namespace_cache_size = size
462
654
  return self
463
655
 
464
656
  def namespace_id_cache_size(self, size: int) -> "NativeStoreConfig.Builder":
657
+ """
658
+ Sets the namespace ID cache size for the NativeStore configuration.
659
+
660
+ Args:
661
+ size (int): The namespace ID cache size for the NativeStore configuration.
662
+
663
+ Returns:
664
+ NativeStoreConfig.Builder: The builder instance.
665
+ """
465
666
  self._namespace_id_cache_size = size
466
667
  return self
467
668
 
468
669
  def iteration_cache_sync_threshold(
469
670
  self, threshold: int
470
671
  ) -> "NativeStoreConfig.Builder":
672
+ """
673
+ Sets the iteration cache sync threshold for the NativeStore configuration.
674
+
675
+ Args:
676
+ threshold (int): The iteration cache sync threshold for the NativeStore configuration.
677
+
678
+ Returns:
679
+ NativeStoreConfig.Builder: The builder instance.
680
+ """
471
681
  self._iteration_cache_sync_threshold = threshold
472
682
  return self
473
683
 
474
684
  def default_query_evaluation_mode(
475
685
  self, mode: str
476
686
  ) -> "NativeStoreConfig.Builder":
687
+ """
688
+ Sets the default query evaluation mode for the NativeStore configuration.
689
+
690
+ Args:
691
+ mode (str): The default query evaluation mode for the NativeStore configuration.
692
+
693
+ Returns:
694
+ NativeStoreConfig.Builder: The builder instance.
695
+ """
477
696
  self._default_query_evaluation_mode = mode
478
697
  return self
479
698
 
@@ -529,30 +748,81 @@ class ElasticsearchStoreConfig(SailConfig):
529
748
  self._default_query_evaluation_mode: Optional[str] = None
530
749
 
531
750
  def port(self, port: int) -> "ElasticsearchStoreConfig.Builder":
751
+ """
752
+ Sets the port for the ElasticsearchStore configuration.
753
+
754
+ Args:
755
+ port (int): The port for the ElasticsearchStore configuration.
756
+
757
+ Returns:
758
+ ElasticsearchStoreConfig.Builder: The builder instance.
759
+ """
532
760
  self._port = port
533
761
  return self
534
762
 
535
763
  def cluster_name(self, cluster_name: str) -> "ElasticsearchStoreConfig.Builder":
764
+ """
765
+ Sets the cluster name for the ElasticsearchStore configuration.
766
+
767
+ Args:
768
+ cluster_name (str): The cluster name for the ElasticsearchStore configuration.
769
+
770
+ Returns:
771
+ ElasticsearchStoreConfig.Builder: The builder instance.
772
+ """
536
773
  self._cluster_name = cluster_name
537
774
  return self
538
775
 
539
776
  def index(self, index: str) -> "ElasticsearchStoreConfig.Builder":
777
+ """
778
+ Sets the index for the ElasticsearchStore configuration.
779
+
780
+ Args:
781
+ index (str): The index for the ElasticsearchStore configuration.
782
+
783
+ Returns:
784
+ ElasticsearchStoreConfig.Builder: The builder instance.
785
+ """
540
786
  self._index = index
541
787
  return self
542
788
 
543
789
  def iteration_cache_sync_threshold(
544
790
  self, threshold: int
545
791
  ) -> "ElasticsearchStoreConfig.Builder":
792
+ """
793
+ Sets the iteration cache sync threshold for the ElasticsearchStore configuration.
794
+
795
+ Args:
796
+ threshold (int): The iteration cache sync threshold for the ElasticsearchStore configuration.
797
+
798
+ Returns:
799
+ ElasticsearchStoreConfig.Builder: The builder instance.
800
+ """
546
801
  self._iteration_cache_sync_threshold = threshold
547
802
  return self
548
803
 
549
804
  def default_query_evaluation_mode(
550
805
  self, mode: str
551
806
  ) -> "ElasticsearchStoreConfig.Builder":
807
+ """
808
+ Sets the default query evaluation mode for the ElasticsearchStore configuration.
809
+
810
+ Args:
811
+ mode (str): The default query evaluation mode for the ElasticsearchStore configuration.
812
+
813
+ Returns:
814
+ ElasticsearchStoreConfig.Builder: The builder instance.
815
+ """
552
816
  self._default_query_evaluation_mode = mode
553
817
  return self
554
818
 
555
819
  def build(self) -> "ElasticsearchStoreConfig":
820
+ """
821
+ Builds and returns the ElasticsearchStoreConfig instance.
822
+
823
+ Returns:
824
+ ElasticsearchStoreConfig: The constructed ElasticsearchStoreConfig instance.
825
+ """
556
826
  return ElasticsearchStoreConfig(
557
827
  hostname=self._hostname,
558
828
  port=self._port,
@@ -576,6 +846,14 @@ class SchemaCachingRDFSInferencerConfig(SailConfig):
576
846
  iteration_cache_sync_threshold: Optional[int] = None,
577
847
  default_query_evaluation_mode: Optional[str] = None,
578
848
  ):
849
+ """
850
+ Initializes a new SchemaCachingRDFSInferencerConfig.
851
+
852
+ Args:
853
+ delegate (SailConfig): The delegate configuration for the SchemaCachingRDFSInferencer.
854
+ iteration_cache_sync_threshold (Optional[int]): The iteration cache sync threshold.
855
+ default_query_evaluation_mode (Optional[str]): The default query evaluation mode.
856
+ """
579
857
  super().__init__(
580
858
  sail_type=SchemaCachingRDFSInferencerConfig.TYPE,
581
859
  iteration_cache_sync_threshold=iteration_cache_sync_threshold,
@@ -586,6 +864,12 @@ class SchemaCachingRDFSInferencerConfig(SailConfig):
586
864
  def add_to_graph(self, graph: Graph) -> URIRef:
587
865
  """
588
866
  Adds the SchemaCachingRDFSInferencer configuration to the RDF graph.
867
+
868
+ Args:
869
+ graph (Graph): The RDF graph to add the configuration to.
870
+
871
+ Returns:
872
+ URIRef: The URIRef of the added configuration.
589
873
  """
590
874
  sail_node = super().add_to_graph(graph)
591
875
  delegate_node = self.config_params["delegate"].to_rdf(graph)
@@ -601,16 +885,40 @@ class SchemaCachingRDFSInferencerConfig(SailConfig):
601
885
  def iteration_cache_sync_threshold(
602
886
  self, threshold: int
603
887
  ) -> "SchemaCachingRDFSInferencerConfig.Builder":
888
+ """
889
+ Sets the iteration cache sync threshold for the SchemaCachingRDFSInferencer configuration.
890
+
891
+ Args:
892
+ threshold (int): The iteration cache sync threshold for the SchemaCachingRDFSInferencer configuration.
893
+
894
+ Returns:
895
+ SchemaCachingRDFSInferencerConfig.Builder: The builder instance.
896
+ """
604
897
  self._iteration_cache_sync_threshold = threshold
605
898
  return self
606
899
 
607
900
  def default_query_evaluation_mode(
608
901
  self, mode: str
609
902
  ) -> "SchemaCachingRDFSInferencerConfig.Builder":
903
+ """
904
+ Sets the default query evaluation mode for the SchemaCachingRDFSInferencer configuration.
905
+
906
+ Args:
907
+ mode (str): The default query evaluation mode for the SchemaCachingRDFSInferencer configuration.
908
+
909
+ Returns:
910
+ SchemaCachingRDFSInferencerConfig.Builder: The builder instance.
911
+ """
610
912
  self._default_query_evaluation_mode = mode
611
913
  return self
612
914
 
613
915
  def build(self) -> "SchemaCachingRDFSInferencerConfig":
916
+ """
917
+ Builds and returns the SchemaCachingRDFSInferencerConfig instance.
918
+
919
+ Returns:
920
+ SchemaCachingRDFSInferencerConfig: The constructed SchemaCachingRDFSInferencerConfig instance.
921
+ """
614
922
  return SchemaCachingRDFSInferencerConfig(
615
923
  delegate=self._delegate,
616
924
  iteration_cache_sync_threshold=self._iteration_cache_sync_threshold,
@@ -631,6 +939,14 @@ class DirectTypeHierarchyInferencerConfig(SailConfig):
631
939
  iteration_cache_sync_threshold: Optional[int] = None,
632
940
  default_query_evaluation_mode: Optional[str] = None,
633
941
  ):
942
+ """
943
+ Initializes a new DirectTypeHierarchyInferencerConfig.
944
+
945
+ Args:
946
+ delegate (SailConfig): The delegate configuration for the DirectTypeHierarchyInferencer.
947
+ iteration_cache_sync_threshold (Optional[int]): The iteration cache sync threshold.
948
+ default_query_evaluation_mode (Optional[str]): The default query evaluation mode.
949
+ """
634
950
  super().__init__(
635
951
  sail_type=DirectTypeHierarchyInferencerConfig.TYPE,
636
952
  iteration_cache_sync_threshold=iteration_cache_sync_threshold,
@@ -641,6 +957,12 @@ class DirectTypeHierarchyInferencerConfig(SailConfig):
641
957
  def add_to_graph(self, graph: Graph) -> URIRef:
642
958
  """
643
959
  Adds the DirectTypeHierarchyInferencerConfig to the graph
960
+
961
+ Args:
962
+ graph (Graph): The RDF graph to add the configuration to.
963
+
964
+ Returns:
965
+ URIRef: The URIRef of the added configuration.
644
966
  """
645
967
  sail_node = super().add_to_graph(graph)
646
968
  delegate_node = self.config_params["delegate"].to_rdf(graph)
@@ -649,6 +971,12 @@ class DirectTypeHierarchyInferencerConfig(SailConfig):
649
971
 
650
972
  class Builder:
651
973
  def __init__(self, delegate: "SailConfig"):
974
+ """
975
+ Initializes a new DirectTypeHierarchyInferencerConfig.Builder.
976
+
977
+ Args:
978
+ delegate (SailConfig): The delegate configuration for the DirectTypeHierarchyInferencer.
979
+ """
652
980
  self._delegate = delegate
653
981
  self._iteration_cache_sync_threshold: Optional[int] = None
654
982
  self._default_query_evaluation_mode: Optional[str] = None
@@ -656,16 +984,40 @@ class DirectTypeHierarchyInferencerConfig(SailConfig):
656
984
  def iteration_cache_sync_threshold(
657
985
  self, threshold: int
658
986
  ) -> "DirectTypeHierarchyInferencerConfig.Builder":
987
+ """
988
+ Sets the iteration cache sync threshold for the DirectTypeHierarchyInferencer configuration.
989
+
990
+ Args:
991
+ threshold (int): The iteration cache sync threshold for the DirectTypeHierarchyInferencer configuration.
992
+
993
+ Returns:
994
+ DirectTypeHierarchyInferencerConfig.Builder: The builder instance.
995
+ """
659
996
  self._iteration_cache_sync_threshold = threshold
660
997
  return self
661
998
 
662
999
  def default_query_evaluation_mode(
663
1000
  self, mode: str
664
1001
  ) -> "DirectTypeHierarchyInferencerConfig.Builder":
1002
+ """
1003
+ Sets the default query evaluation mode for the DirectTypeHierarchyInferencer configuration.
1004
+
1005
+ Args:
1006
+ mode (str): The default query evaluation mode for the DirectTypeHierarchyInferencer configuration.
1007
+
1008
+ Returns:
1009
+ DirectTypeHierarchyInferencerConfig.Builder: The builder instance.
1010
+ """
665
1011
  self._default_query_evaluation_mode = mode
666
1012
  return self
667
1013
 
668
1014
  def build(self) -> "DirectTypeHierarchyInferencerConfig":
1015
+ """
1016
+ Builds and returns the DirectTypeHierarchyInferencerConfig instance.
1017
+
1018
+ Returns:
1019
+ DirectTypeHierarchyInferencerConfig: The constructed DirectTypeHierarchyInferencerConfig instance.
1020
+ """
669
1021
  return DirectTypeHierarchyInferencerConfig(
670
1022
  delegate=self._delegate,
671
1023
  iteration_cache_sync_threshold=self._iteration_cache_sync_threshold,
@@ -701,6 +1053,29 @@ class SHACLSailConfig(SailConfig):
701
1053
  iteration_cache_sync_threshold: Optional[int] = None,
702
1054
  default_query_evaluation_mode: Optional[str] = None,
703
1055
  ):
1056
+ """
1057
+ Initializes a new SHACLSailConfig.
1058
+
1059
+ Args:
1060
+ delegate (SailConfig): The delegate configuration for the SHACL Sail.
1061
+ parallel_validation (Optional[bool]): Whether to enable parallel validation.
1062
+ undefined_target_validates_all_subjects (Optional[bool]): Whether to validate all subjects when undefined targets are encountered.
1063
+ log_validation_plans (Optional[bool]): Whether to log validation plans.
1064
+ log_validation_violations (Optional[bool]): Whether to log validation violations.
1065
+ ignore_no_shapes_loaded_exception (Optional[bool]): Whether to ignore exceptions when no shapes are loaded.
1066
+ validation_enabled (Optional[bool]): Whether to enable validation.
1067
+ cache_select_nodes (Optional[bool]): Whether to cache select nodes.
1068
+ global_log_validation_execution (Optional[bool]): Whether to log validation execution globally.
1069
+ rdfs_sub_class_reasoning (Optional[bool]): Whether to enable RDFS sub-class reasoning.
1070
+ performance_logging (Optional[bool]): Whether to enable performance logging.
1071
+ serializable_validation (Optional[bool]): Whether to enable serializable validation.
1072
+ eclipse_rdf4j_shacl_extensions (Optional[bool]): Whether to enable Eclipse RDF4J SHACL extensions.
1073
+ dash_data_shapes (Optional[bool]): Whether to enable Dash Data Shapes.
1074
+ validation_results_limit_total (Optional[int]): The total number of validation results to limit.
1075
+ validation_results_limit_per_constraint (Optional[int]): The number of validation results to limit per constraint.
1076
+ iteration_cache_sync_threshold (Optional[int]): The iteration cache sync threshold.
1077
+ default_query_evaluation_mode (Optional[str]): The default query evaluation mode.
1078
+ """
704
1079
  super().__init__(
705
1080
  sail_type=SHACLSailConfig.TYPE,
706
1081
  iteration_cache_sync_threshold=iteration_cache_sync_threshold,
@@ -753,7 +1128,15 @@ class SHACLSailConfig(SailConfig):
753
1128
  )
754
1129
 
755
1130
  def add_to_graph(self, graph: Graph) -> URIRef:
756
- """Adds the SHACLSailConfig to the RDF graph."""
1131
+ """
1132
+ Adds the SHACLSailConfig to the RDF graph.
1133
+
1134
+ Args:
1135
+ graph (Graph): The RDF graph to add the configuration to.
1136
+
1137
+ Returns:
1138
+ URIRef: The URIRef of the added configuration.
1139
+ """
757
1140
  sail_node = super().add_to_graph(graph) # Get the basic node
758
1141
  delegate_node = self.config_params["delegate"].to_rdf(graph)
759
1142
  graph.add((sail_node, CONFIG.delegate, delegate_node))
@@ -775,6 +1158,12 @@ class SHACLSailConfig(SailConfig):
775
1158
 
776
1159
  class Builder:
777
1160
  def __init__(self, delegate: "SailConfig"):
1161
+ """
1162
+ Initializes a new SHACLSailConfig.Builder.
1163
+
1164
+ Args:
1165
+ delegate (SailConfig): The delegate configuration for the SHACL Sail.
1166
+ """
778
1167
  self._delegate = delegate
779
1168
  self._parallel_validation: Optional[bool] = None
780
1169
  self._undefined_target_validates_all_subjects: Optional[bool] = None
@@ -795,88 +1184,247 @@ class SHACLSailConfig(SailConfig):
795
1184
  self._default_query_evaluation_mode: Optional[str] = None
796
1185
 
797
1186
  def parallel_validation(self, value: bool) -> "SHACLSailConfig.Builder":
1187
+ """
1188
+ Sets the parallel validation flag for the SHACL Sail configuration.
1189
+
1190
+ Args:
1191
+ value (bool): The parallel validation flag for the SHACL Sail configuration.
1192
+
1193
+ Returns:
1194
+ SHACLSailConfig.Builder: The builder instance.
1195
+ """
798
1196
  self._parallel_validation = value
799
1197
  return self
800
1198
 
801
1199
  def undefined_target_validates_all_subjects(
802
1200
  self, value: bool
803
1201
  ) -> "SHACLSailConfig.Builder":
1202
+ """
1203
+ Sets the undefined target validates all subjects flag for the SHACL Sail configuration.
1204
+
1205
+ Args:
1206
+ value (bool): The undefined target validates all subjects flag for the SHACL Sail configuration.
1207
+
1208
+ Returns:
1209
+ SHACLSailConfig.Builder: The builder instance.
1210
+ """
804
1211
  self._undefined_target_validates_all_subjects = value
805
1212
  return self
806
1213
 
807
1214
  def log_validation_plans(self, value: bool) -> "SHACLSailConfig.Builder":
1215
+ """
1216
+ Sets the log validation plans flag for the SHACL Sail configuration.
1217
+
1218
+ Args:
1219
+ value (bool): The log validation plans flag for the SHACL Sail configuration.
1220
+
1221
+ Returns:
1222
+ SHACLSailConfig.Builder: The builder instance.
1223
+ """
808
1224
  self._log_validation_plans = value
809
1225
  return self
810
1226
 
811
1227
  def log_validation_violations(self, value: bool) -> "SHACLSailConfig.Builder":
1228
+ """
1229
+ Sets the log validation violations flag for the SHACL Sail configuration.
1230
+
1231
+ Args:
1232
+ value (bool): The log validation violations flag for the SHACL Sail configuration.
1233
+
1234
+ Returns:
1235
+ SHACLSailConfig.Builder: The builder instance.
1236
+ """
812
1237
  self._log_validation_violations = value
813
1238
  return self
814
1239
 
815
1240
  def ignore_no_shapes_loaded_exception(
816
1241
  self, value: bool
817
1242
  ) -> "SHACLSailConfig.Builder":
1243
+ """
1244
+ Sets the ignore no shapes loaded exception flag for the SHACL Sail configuration.
1245
+
1246
+ Args:
1247
+ value (bool): The ignore no shapes loaded exception flag for the SHACL Sail configuration.
1248
+
1249
+ Returns:
1250
+ SHACLSailConfig.Builder: The builder instance.
1251
+ """
818
1252
  self._ignore_no_shapes_loaded_exception = value
819
1253
  return self
820
1254
 
821
1255
  def validation_enabled(self, value: bool) -> "SHACLSailConfig.Builder":
1256
+ """
1257
+ Sets the validation enabled flag for the SHACL Sail configuration.
1258
+
1259
+ Args:
1260
+ value (bool): The validation enabled flag for the SHACL Sail configuration.
1261
+
1262
+ Returns:
1263
+ SHACLSailConfig.Builder: The builder instance.
1264
+ """
822
1265
  self._validation_enabled = value
823
1266
  return self
824
1267
 
825
1268
  def cache_select_nodes(self, value: bool) -> "SHACLSailConfig.Builder":
1269
+ """
1270
+ Sets the cache select nodes flag for the SHACL Sail configuration.
1271
+
1272
+ Args:
1273
+ value (bool): The cache select nodes flag for the SHACL Sail configuration.
1274
+
1275
+ Returns:
1276
+ SHACLSailConfig.Builder: The builder instance.
1277
+ """
826
1278
  self._cache_select_nodes = value
827
1279
  return self
828
1280
 
829
1281
  def global_log_validation_execution(
830
1282
  self, value: bool
831
1283
  ) -> "SHACLSailConfig.Builder":
1284
+ """
1285
+ Sets the global log validation execution flag for the SHACL Sail configuration.
1286
+
1287
+ Args:
1288
+ value (bool): The global log validation execution flag for the SHACL Sail configuration.
1289
+
1290
+ Returns:
1291
+ SHACLSailConfig.Builder: The builder instance.
1292
+ """
832
1293
  self._global_log_validation_execution = value
833
1294
  return self
834
1295
 
835
1296
  def rdfs_sub_class_reasoning(self, value: bool) -> "SHACLSailConfig.Builder":
1297
+ """
1298
+ Sets the RDFS sub-class reasoning flag for the SHACL Sail configuration.
1299
+
1300
+ Args:
1301
+ value (bool): The RDFS sub-class reasoning flag for the SHACL Sail configuration.
1302
+
1303
+ Returns:
1304
+ SHACLSailConfig.Builder: The builder instance.
1305
+ """
836
1306
  self._rdfs_sub_class_reasoning = value
837
1307
  return self
838
1308
 
839
1309
  def performance_logging(self, value: bool) -> "SHACLSailConfig.Builder":
1310
+ """
1311
+ Sets the performance logging flag for the SHACL Sail configuration.
1312
+
1313
+ Args:
1314
+ value (bool): The performance logging flag for the SHACL Sail configuration.
1315
+
1316
+ Returns:
1317
+ SHACLSailConfig.Builder: The builder instance.
1318
+ """
840
1319
  self._performance_logging = value
841
1320
  return self
842
1321
 
843
1322
  def serializable_validation(self, value: bool) -> "SHACLSailConfig.Builder":
1323
+ """
1324
+ Sets the serializable validation flag for the SHACL Sail configuration.
1325
+
1326
+ Args:
1327
+ value (bool): The serializable validation flag for the SHACL Sail configuration.
1328
+
1329
+ Returns:
1330
+ SHACLSailConfig.Builder: The builder instance.
1331
+ """
844
1332
  self._serializable_validation = value
845
1333
  return self
846
1334
 
847
1335
  def eclipse_rdf4j_shacl_extensions(
848
1336
  self, value: bool
849
1337
  ) -> "SHACLSailConfig.Builder":
1338
+ """
1339
+ Sets the Eclipse RDF4J SHACL extensions flag for the SHACL Sail configuration.
1340
+
1341
+ Args:
1342
+ value (bool): The Eclipse RDF4J SHACL extensions flag for the SHACL Sail configuration.
1343
+
1344
+ Returns:
1345
+ SHACLSailConfig.Builder: The builder instance.
1346
+ """
850
1347
  self._eclipse_rdf4j_shacl_extensions = value
851
1348
  return self
852
1349
 
853
1350
  def dash_data_shapes(self, value: bool) -> "SHACLSailConfig.Builder":
1351
+ """
1352
+ Sets the Dash Data Shapes flag for the SHACL Sail configuration.
1353
+
1354
+ Args:
1355
+ value (bool): The Dash Data Shapes flag for the SHACL Sail configuration.
1356
+
1357
+ Returns:
1358
+ SHACLSailConfig.Builder: The builder instance.
1359
+ """
854
1360
  self._dash_data_shapes = value
855
1361
  return self
856
1362
 
857
1363
  def validation_results_limit_total(
858
1364
  self, value: int
859
1365
  ) -> "SHACLSailConfig.Builder":
1366
+ """
1367
+ Sets the validation results limit total flag for the SHACL Sail configuration.
1368
+
1369
+ Args:
1370
+ value (int): The validation results limit total flag for the SHACL Sail configuration.
1371
+
1372
+ Returns:
1373
+ SHACLSailConfig.Builder: The builder instance.
1374
+ """
860
1375
  self._validation_results_limit_total = value
861
1376
  return self
862
1377
 
863
1378
  def validation_results_limit_per_constraint(
864
1379
  self, value: int
865
1380
  ) -> "SHACLSailConfig.Builder":
1381
+ """
1382
+ Sets the validation results limit per constraint flag for the SHACL Sail configuration.
1383
+
1384
+ Args:
1385
+ value (int): The validation results limit per constraint flag for the SHACL Sail configuration.
1386
+
1387
+ Returns:
1388
+ SHACLSailConfig.Builder: The builder instance.
1389
+ """
866
1390
  self._validation_results_limit_per_constraint = value
867
1391
  return self
868
1392
 
869
1393
  def iteration_cache_sync_threshold(
870
1394
  self, threshold: int
871
1395
  ) -> "SHACLSailConfig.Builder":
1396
+ """
1397
+ Sets the iteration cache sync threshold flag for the SHACL Sail configuration.
1398
+
1399
+ Args:
1400
+ threshold (int): The iteration cache sync threshold flag for the SHACL Sail configuration.
1401
+
1402
+ Returns:
1403
+ SHACLSailConfig.Builder: The builder instance.
1404
+ """
872
1405
  self._iteration_cache_sync_threshold = threshold
873
1406
  return self
874
1407
 
875
1408
  def default_query_evaluation_mode(self, mode: str) -> "SHACLSailConfig.Builder":
1409
+ """
1410
+ Sets the default query evaluation mode flag for the SHACL Sail configuration.
1411
+
1412
+ Args:
1413
+ mode (str): The default query evaluation mode flag for the SHACL Sail configuration.
1414
+
1415
+ Returns:
1416
+ SHACLSailConfig.Builder: The builder instance.
1417
+ """
876
1418
  self._default_query_evaluation_mode = mode
877
1419
  return self
878
1420
 
879
1421
  def build(self) -> "SHACLSailConfig":
1422
+ """
1423
+ Builds the SHACLSailConfig.
1424
+
1425
+ Returns:
1426
+ SHACLSailConfig: The built SHACLSailConfig.
1427
+ """
880
1428
  return SHACLSailConfig(
881
1429
  delegate=self._delegate,
882
1430
  parallel_validation=self._parallel_validation,