- Documentation
- Reference manual
- Packages
- SWI-Prolog Semantic Web Library 3.0
- Introduction
- Scalability
- Two RDF APIs
- Plugin modules for rdf_db
- library(semweb/turtle): Turtle: Terse RDF Triple Language
- library(semweb/rdf_ntriples): Process files in the RDF N-Triples format
- library(semweb/rdfa): Extract RDF from an HTML or XML DOM
- library(semweb/rdfs): RDFS related queries
- Managing RDF input files
- library(semweb/sparql_client): SPARQL client library
- library(semweb/rdf_compare): Compare RDF graphs
- library(semweb/rdf_portray): Portray RDF resources
- Related packages
- Version 3 release notes
- SWI-Prolog Semantic Web Library 3.0
14 Version 3 release notes
RDF-DB version 3 is a major redesign of the SWI-Prolog RDF infrastructure. Nevertheles, version 3 is almost perfectly upward compatible with version 2. Below are some issues to take into consideration when upgrading.
Version 2 did not allow for modifications while read operations were in progress, for example due to an open choice point. As a consequence, operations that both queried and modified the database had to be wrapped in a transaction or the modifications had to be buffered as Prolog data structures. In both cases, the RDF store was not modified during the query phase. In version 3, modifications are allowed while read operations are in progress and follow the Prolog logical update view semantics. This is different from using a transaction in version 2, where the view for all read operations was frozen at the start of the transaction. In version 3, every read operation sees the store frozen at the moment that the operation was started.
We illustrate the difference by writing a forwards entailment rule that adds a sibling relation. In version 2, we could perform this operation using one of the following:
add_siblings_1 :- findall(S-O, ( rdf(S, f:parent, P), rdf(O, f:parent, P), S \== O ), Pairs), forall(member(S-O, Pairs), rdf_assert(S,f:sibling,O)). add_siblings_2 :- rdf_transaction( forall(( rdf(S, f:parent, P), rdf(O, f:parent, P), S \== O ), rdf_assert(S, f:sibling, O))).
In version 3, we can write this in the natural Prolog style below. In itself, this may not seem a big advantage because wrapping such operations in a transaction is often a good style anyway. The story changes with more complicated constrol structures that combine iterations with steps that depend on triples asserted in previous steps. Such scenarios can be programmed naturally in the current version.
add_siblings_3 :- forall(( rdf(S, f:parent, P), rdf(O, f:parent, P), S \== O ), rdf_assert(S, f:sibling, O)).
In version 3, code that combines queries with modification has the same semantics whether executed inside or outside a transaction. This property makes reusing such predicates predictable.
- rdf_statistics/2
- Various statistics have been renamed or changed:
sources
is renamed intographs
triples_by_file
is renamed intotriples_by_graph
gc
has additional argumentscore
is removed.
- rdf_generation/1
- Generations inside a transaction are represented as BaseGeneration+TransactionGeneration, where BaseGeneration is the global generation where the transaction started and TransactionGeneration expresses the generation within the transaction. Counting generation has changed as well. In particular, comitting a transaction steps the generation only by one.
- rdf_current_ns/1, rdf_register_ns/2, rdf_register_ns/3
- These predicates are renamed into rdf_current_prefix/1, rdf_register_prefix/2, rdf_register_prefix/3. The old predicates are still available as deprecated predicates.
- rdf_unload/1
- now only accepts a source location and deletes the associated graph using rdf_unload_graph/1.
Acknowledgements
This research was supported by the following projects: MIA and MultimediaN project (www.multimedian.nl) funded through the BSIK programme of the Dutch Government, the FP-6 project HOPS of the European Commission, the COMBINE project supported by the ONR Global NICOP grant N62909-11-1-7060 and the Dutch national program COMMIT.
Index
- ?
- compressed data
- 4.2
- concurrent/3
- 4.6
- dc:title
- gz, format
- 4.2
- gzip
- 4.2
- lang_equal/2
- lang_matches/2
- lib:source
- load_data/0
- 9.3
- owl:imports
- rdf/3
- 1 8
- rdf/4
- 4.6
- rdf_active_transaction/1
- rdf_alt/3
- rdf_assert/3
- rdf_assert/4
- rdf_assert_alt/3
- rdf_assert_alt/4
- rdf_assert_bag/2
- rdf_assert_bag/3
- rdf_assert_list/2
- rdf_assert_list/3
- rdf_assert_seq/2
- rdf_assert_seq/3
- rdf_attach_db/2
- 4.6
- rdf_attach_library/1
- 9.1.2 9.1.2 9.2
- rdf_bag/2
- rdf_bnode/1
- 8.2
- rdf_cache_file/3
- rdf_canonical_literal/2
- rdf_compare/3
- rdf_create_bnode/1
- rdf_create_graph/1
- rdf_current_db/1
- 4.6.1
- rdf_current_literal/1
- rdf_current_ns/1
- 14
- rdf_current_ns/2
- rdf_current_predicate/1
- rdf_current_prefix/1
- 14
- rdf_current_prefix/2
- rdf_current_snapshot/1
- rdf_db:rdf_file_type/2
- rdf_db:rdf_input_info/3
- rdf_db:rdf_load_stream/3
- rdf_db:rdf_open_hook/3
- rdf_db:url_protocol/1
- rdf_db_to_file/2
- rdf_default_graph/1
- rdf_default_graph/2
- rdf_delete_literal_map/2
- rdf_delete_snapshot/1
- rdf_destroy_literal_map/1
- rdf_detach_db/0
- rdf_equal/2
- rdf_equal_graphs/3
- rdf_estimate_complexity/4
- rdf_file_type/2
- 4.1 4.1
- rdf_find_literal_map/3
- 4.5.1
- rdf_find_literals/2
- 4.5 4.5
- rdf_flush_journals/1
- rdf_gc/0
- rdf_generation/1
- 14
- rdf_global_id/2
- rdf_global_object/2
- rdf_global_term/2
- rdf_graph/1
- rdf_graph_property/2
- rdf_has/3
- rdf_has/4
- rdf_has/[3,4]
- 8.1 8.1
- rdf_input_info/3
- 4.1
- rdf_insert_literal_map/3
- 4.5.1
- rdf_insert_literal_map/4
- rdf_iri/1
- rdf_is_bnode/1
- rdf_is_iri/1
- rdf_is_literal/1
- rdf_is_name/1
- rdf_is_object/1
- rdf_is_predicate/1
- rdf_is_resource/1
- rdf_is_subject/1
- rdf_is_term/1
- rdf_journal_file/2
- 4.6.1
- rdf_keys_in_literal_map/3
- rdf_last/2
- rdf_length/2
- rdf_lexical_form/2
- rdf_list/1
- rdf_list/2
- rdf_list_library/0
- 9.1 9.1 9.2
- rdf_list_library/1
- 9.1.2 9.2 9.2
- rdf_list_library/2
- 9.1.2 9.1.2
- rdf_literal/1
- rdf_load/1
- rdf_load/2
- 3.4 3.4 4 4.1
- rdf_load_db/1
- 3.4 3.4 3.4
- rdf_load_library/2
- 9.1 9.1 9.1.2 9.1.2
- rdf_load_stream/3
- 4.1 4.1
- rdf_load_turtle/3
- rdf_make/0
- rdf_match_label/3
- rdf_member/2
- rdf_monitor/2
- 1 3.4 4.5 4.5.1
- rdf_name/1
- rdf_new_literal_map/1
- rdf_node/1
- rdf_nth0/3
- rdf_nth1/3
- rdf_object/1
- rdf_persistency/2
- rdf_portray_as/1
- rdf_portray_lang/1
- rdf_predicate/1
- rdf_predicate_property/2
- rdf_process_ntriples/3
- rdf_process_turtle/3
- rdf_reachable/3
- rdf_reachable/5
- rdf_read_nquads/3
- rdf_read_ntriples/3
- rdf_read_turtle/3
- rdf_register_ns/2
- 9.1 14
- rdf_register_ns/3
- 14
- rdf_register_prefix/2
- 14
- rdf_register_prefix/3
- 14
- rdf_reset_db/0
- 3.4
- rdf_reset_literal_map/1
- 4.5.1
- rdf_resource/1
- rdf_retract_list/1
- rdf_retractall/3
- 4.6.1
- rdf_retractall/4
- rdf_save/1
- rdf_save/2
- rdf_save_canonical_trig/2
- rdf_save_canonical_turtle/2
- rdf_save_db/1
- rdf_save_db/2
- 4.6
- rdf_save_footer/1
- rdf_save_header/2
- rdf_save_ntriples/2
- rdf_save_subject/3
- rdf_save_trig/2
- rdf_save_turtle/2
- rdf_seq/2
- rdf_set/1
- rdf_set_cache_options/1
- rdf_set_graph/2
- rdf_set_predicate/2
- rdf_snapshot/1
- rdf_source/1
- 4.6 4.6.1
- rdf_source_location/2
- rdf_statistics/1
- rdf_statistics/2
- 14
- rdf_statistics_literal_map/2
- rdf_subject/1
- rdf_term/1
- rdf_token_expansions/2
- rdf_tokenize_literal/2
- rdf_transaction/1
- rdf_transaction/2
- 3.4 3.4
- rdf_transaction/3
- rdf_unload/1
- 3.4 14
- rdf_unload_graph/1
- 14
- rdf_update/4
- 4.6.1
- rdf_update/5
- rdf_update_duplicates/0
- rdf_version/1
- rdf_where/1
- rdfs_assert_list/2
- rdfs_assert_list/3
- 8.2
- rdfs_class_property/2
- rdfs_container/2
- rdfs_container_membership_property/1
- rdfs_container_membership_property/2
- rdfs_individual_of/2
- rdfs_list_to_prolog_list/2
- rdfs_member/2
- rdfs_nth0/3
- rdfs_subclass_of/2
- rdfs_subproperty_of/2
- read_nquad/2
- read_ntriple/2
- read_ntuple/2
- read_rdfa/3
- sparql_query/3
- sparql_read_json_result/2
- sparql_read_xml_result/2
- sparql_set_server/1
- time_file/2
- 4.1
- tokenize_atom/2
- 4.5 4.5
- xhtml
- 4.3
- xml_rdfa/3
- lib:CloudNode
- ClioPatria
- 13
- Collection,parseType
- 8.2
- I
- owl:versionInfo
- N
- lib:Namespace
- O
- lib:Ontology
- OWL2
- 13
- P
- Persistent store
- 4.6
- R
- RDF-Schema
- 8
- S
- SPARQL
- 13
- T
- Thea
- 13
- parseType,Collection
- 8.2
- U
- lib:baseURI
- V
- lib:Virtual
- {
- /1