A time-aware RDF data indexing and querying method based on an extended feature set

CN117493576BActive Publication Date: 2026-10-20WUHAN UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311456768.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2026-10-20
Estimated Expiration
2043-11-01

AI Technical Summary

Technical Problem

[0004]本发明解决的技术问题在于传统拓展特征集数据库在处理时态RDF数据时数据复杂度过高,占用的存储空间较大,检索效率较低的问题,针对以上问题,本发明提供了一种基于拓展特征模型的时态RDF数据的索引和查询方法,具体采用了如下技术方案:

Benefits of technology

[0045]本发明通过将三元组拓展成五元组对时态RDF数据进行表示,并设计恒定时间类型和时间区间类型两种时态元组模型,有效减少了传统拓展特征集数据库管理时态RDF数据时的复杂度,并通过对拓展特征集索引结构进行优化,采用键值映射方式根据时间信息对特征集索引的位集的每个位对应的四元表构建区间索引,可较大幅度提升面向时态RDF数据的检索效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117493576B_ABST
    Figure CN117493576B_ABST
Patent Text Reader

Abstract

The application provides a time-based RDF data index and query method based on an extended feature set, the index method comprising representing time-based RDF data in a five-tuple format; applying a key-value structure to construct a feature set index and an extended feature set index for a triple part of the time-based RDF, and constructing an interval index for the time-based RDF according to time information; the query method comprising parsing a time-based query statement, binding a time-based constraint condition for each query pattern in a query graph; extracting a feature set, an extended feature set and an extended feature set chain in the query pattern, and uniquely identifying each feature set; applying the feature set index, the extended feature set index and the interval index to match each extended feature set chain; merging a result set of the feature sets of each query pattern, and returning a final result. The application effectively reduces the complexity of a conventional extended feature set database in managing time-based RDF data, and greatly improves the retrieval efficiency of time-based RDF data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph query technology, and in particular to a temporal RDF data indexing and querying method based on an extended feature set. Background Technology

[0002] Resource Description Framework (RDF), a crucial component of the W3C Semantic Web architecture, provides a unified specification for describing resource entities in the Semantic Web. Its ease of use, flexibility, and powerful semantic expressive capabilities have led to its widespread application across various fields. In time-sensitive domains, such as finance and social networks, much of the data changes dynamically over time. Therefore, RDF is increasingly used to represent and process large amounts of temporal application data.

[0003] Extended feature set indexes are a type of efficient RDF index that can quickly respond to complex queries on large-scale RDF data, eliminate redundancy, and improve the quality of query results. However, existing RDF databases based on extended feature sets can only process RDF triple data. Therefore, temporal data must be converted into classic triple format. This requires introducing additional nodes to associate triples with their corresponding time information, which increases the data volume and complexity, thus consuming more storage space and negatively impacting retrieval efficiency. Summary of the Invention

[0004] The technical problem addressed by this invention is that traditional extended feature set databases suffer from high data complexity, large storage space consumption, and low retrieval efficiency when processing temporal RDF data. To address these issues, this invention provides an indexing and querying method for temporal RDF data based on an extended feature model, specifically employing the following technical solution:

[0005] The first aspect of this invention provides a temporal RDF data indexing method based on extended feature sets, applied to constructing indexes for temporal RDF data, comprising:

[0006] Temporal RDF data is represented in quintuple format, extending the effective time for triplet relations;

[0007] The key-value structure is used to construct feature set indexes and extended feature set indexes for the triples of temporal RDF;

[0008] The application key-value structure constructs a range index for temporal RDF based on time information.

[0009] In the above scheme, temporal RDF data is represented in a 5-tuple format, including:

[0010] Based on the semantics of triplet, time is classified into two types: constant time and time interval, and the time information is converted into integers for representation and storage.

[0011] For constant-time triples, retain their original triple format;

[0012] For triples of time interval type, the time information includes start and end times, which can be expanded into a quintuple format.

[0013] In the above scheme, a key-value structure is applied to construct feature set indexes and extended feature set indexes for the triples portion of the temporal RDF, including:

[0014] Parse temporal RDF 5-tuple data, extract the subject, predicate, and object, and convert the corresponding URI or string of the subject, predicate, and object into integer IDs and store them in an integer array;

[0015] Obtain the feature set and extended feature set of the entire dataset, as well as the corresponding feature set ID and extended feature set ID; and parse out the extended feature set chain of the entire dataset;

[0016] The predicate set of the feature set is represented by a bit set structure;

[0017] The key-value structure is used to construct a feature set index with the feature set id as the key and the feature set bit set as the value;

[0018] The extended feature set index is constructed using a key-value structure with the extended feature set id as the key and the extended feature set as the value.

[0019] In the above scheme, a key-value structure is used to construct a range index for temporal RDF based on time information, including:

[0020] Obtain all the four-tuples corresponding to each predicate and construct a four-tuple table;

[0021] The time range is determined and partitions are constructed based on the minimum and maximum times of the quaternion table;

[0022] Each quad in the quad list is assigned to different intervals in different layers based on time.

[0023] Obtain the interval ID corresponding to each interval;

[0024] Using the interval ID as the key and all quadruples within the interval as the value, a key-value index structure is used to record the association between each interval and all quadruples within the interval.

[0025] The above scheme determines the time range and constructs partitions based on the minimum and maximum times of the quadruple table, including:

[0026] The time range is determined based on the minimum and maximum times of the quaternion list;

[0027] Copy the time range into a preset number of copies, with each copy representing a layer;

[0028] Each layer is divided into 2^x intervals, where x is the layer number.

[0029] In the above scheme, each quadruple in the quadruple table is assigned to different intervals at different levels based on time, including:

[0030] The difference between the start and end times and the minimum time is calculated, then divided by the difference between the maximum and minimum times, multiplied by the number of floors x, and the result is rounded down.

[0031] Starting from the highest level, select an interval. If the rounded start time 'a' is odd, record the quadruple in the 'a'th interval of the current level and increment 'a' by 1. If the rounded end time 'b' is even, record the quadruple in the 'b'th interval of the current level and decrement 'b' by 1.

[0032] The selection process is repeated, and the layer number is decremented by 1 after each selection until the layer number is less than 0 or the start time is greater than the end time, thus completing the allocation of the quadruple.

[0033] According to the above scheme, it also includes assigning a unique identifier id to each feature set and obtaining a set of subject ids for each feature set. Using the feature set id as the key and the set of subject ids that have the feature set as the value, a key-value index is constructed to record the association between the feature set and the set of subjects that have the feature set.

[0034] A second aspect of the present invention also provides a temporal RDF data query method based on an extended feature set, which is based on the temporal RDF data indexing method described in the first aspect above, and includes:

[0035] Parse the temporal query statements, bind temporal constraints to each query pattern in the query graph, and extract the feature set, extended feature set, and extended feature set chain from the query pattern;

[0036] The query statement is matched using feature set indexes, extended feature set indexes, and range indexes.

[0037] Merge and join the result sets of feature sets from various query patterns, and return the final result.

[0038] The above scheme uses feature set indexes, extended feature set indexes, and range indexes to perform matching queries on the query statement, including:

[0039] The extended feature set chains in the query pattern are matched one by one with the extended feature set chains in the dataset. Each extended feature set node of the two extended feature set chains to be matched is matched sequentially, and all matched extended feature set chains in the dataset are collected.

[0040] In the above scheme, each extended feature set node of the two extended feature set chains to be matched is matched sequentially, including:

[0041] The subject feature set and object feature set of the extended feature set are matched bit by bit using the bit set structure of the feature set index.

[0042] Based on the time limit range of the query pattern corresponding to each bit, the corresponding range is found using the range index.

[0043] Iterate through the quadruples within the interval, performing subject-object equivalence matching and temporal constraint matching for each nonvariable.

[0044] Compared with existing technologies, the beneficial effects of this invention are as follows:

[0045] This invention represents temporal RDF data by expanding triples into quintuples and designs two temporal tuple models: constant time type and time interval type. This effectively reduces the complexity of traditional extended feature set databases in managing temporal RDF data. Furthermore, by optimizing the extended feature set index structure and using a key-value mapping method to construct an interval index based on the time information of each bit in the feature set index's bit set, the retrieval efficiency for temporal RDF data can be significantly improved. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0047] Figure 1 This is a summary diagram of the indexing and querying process for temporal RDF data based on extended feature sets provided by the present invention.

[0048] Figure 2 This is a schematic diagram of the indexing process for temporal RDF data based on extended feature sets provided by the present invention.

[0049] Figure 3 This is a schematic diagram of the query process for temporal RDF data based on extended feature sets provided by the present invention. Detailed Implementation

[0050] To further understand the present invention, preferred embodiments of the present invention are described below in conjunction with examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the scope of the claims of the present invention.

[0051] Before describing the embodiments of the present invention in detail, some of the terms used therein are explained as follows:

[0052] Triples are a common representation in RDF. The basic form of a triple mainly includes a subject, a verb, and an object.

[0053] A quintuple is a form of temporal RDF representation. The basic form of a quintuple mainly includes a subject, a verb, an object, a start time, and an end time, representing that the quintuple is valid within that time period.

[0054] A quadruple list is a list of all quintuples that share the same predicate. The predicate is ignored, and the remaining subject, object, start time, and end time are called quadruples.

[0055] Feature set: For each subject, there are several triples with that subject as the subject. The set of predicates of these triples is called the feature set of the subject node.

[0056] Extended feature set: The extended feature set of a triple is composed of the feature set of the subject and the feature set of the object of the triple. The feature set of the subject is called the subject feature set of the feature set, and the feature set of the object is called the object feature set of the triple.

[0057] Extended Feature Set Chain: For an extended feature set A, if there exists another extended feature set B whose subject feature set is the same as the object feature set of A, then there is a connection between A and B: A→B. All extended feature sets that satisfy this condition together constitute the extended feature set chain of A.

[0058] Query graph: The condition triples in a query statement are called query patterns, and all query patterns together constitute the query graph.

[0059] This invention provides an indexing method for temporal RDF data based on an extended feature set. Figure 2 This is a flowchart illustrating the temporal RDF data indexing method based on extended feature sets provided by the present invention; as shown below. Figure 2 As shown, the method is applied to indexing temporal RDF data, including:

[0060] Step S101: Classify time into two types, constant time and time interval, based on the semantics of triples, and represent the temporal RDF data in the form of quintuples according to the above classification;

[0061] Step S102: Construct feature set index and extended feature set index for the triplet part of the quintuple, and store the subject, object and time corresponding to each predicate in the quadruple table;

[0062] Step S103: Construct an interval index for the quadruple table corresponding to each predicate, assign each quadruple to a different interval based on time, and record the correspondence between the partition and all quadruples within the partition through the key-value index;

[0063] Step S104: Construct a key-value index to record the association between the feature set and the set of subjects that have the feature set.

[0064] In this embodiment, step S101, which classifies time into two types—constant time and time interval—based on triple semantics, and represents temporal RDF data using quintuples according to the above classification, specifically involves:

[0065] The time information scale is accurate to the second, using "yyyy-MM-dd HH:mm:ss" as the uniform format for time in the temporal model. For triples of constant time type, they are not expanded; the original triple format is retained. For triples of time interval type, the time information includes the start and end times. Time information for time interval type is connected to the end of the original triple by a colon.

[0066] In this embodiment, step S102 involves constructing a feature set index and an extended feature set index for the triplet portion of the quintuple, and storing the subject, object, and time corresponding to each predicate in a quadruple table. Specifically:

[0067] Parse the temporal RDF quintuple data, converting the URIs and strings corresponding to the subject, verb, and object entities into integer IDs to obtain the subject ID, verb ID, and object ID. Then, iterate through the dataset to obtain the feature sets and extended feature sets. Each feature set and extended feature set is uniquely identified starting from 1, i.e., the feature set ID and extended feature set ID, thus parsing out the extended feature set chain for the entire dataset. The predicate sets of the feature sets are represented using a bit set structure (0-1 numeric strings). The bit number indicates the predicate ID equal to that number, and the bit value (0 or 1) indicates the presence or absence of the predicate. Each bit set is a row, and the bit sets of all feature sets constitute a bitmap, i.e., a two-dimensional table.

[0068] Furthermore, a key-value index is used to store the association between each feature set ID and the bit set of the feature set; this key-value index is called the feature set index. A key-value index is also used to store the association between each extended feature set ID and the extended feature set; this key-value index is called the extended feature set index.

[0069] Furthermore, based on the bitmap, each predicate is extracted vertically to obtain all quintuples with that predicate as the predicate. For each predicate, a quadruple table is applied to store the subject ID, object ID, start time, and end time of each quintuple.

[0070] In this embodiment, step S103 involves constructing a range index for the quadruple table corresponding to each predicate, assigning each quadruple to different ranges based on time, and using a key-value index to record the correspondence between partitions and quadruples. Specifically:

[0071] First, the time range is determined based on the minimum and maximum times of the quadruple table. Then, the time range is copied into a preset number of parts, which is four parts in this embodiment. Each part represents a layer, and each layer is divided into 2^x intervals, where x is the layer number. Finally, each quadruple in the quadruple table is assigned to different intervals in different layers according to the time, and a key-value index is used to record the interval number and the association relationship between all quadruples in the interval.

[0072] For each interval, the layer number id of the interval is shifted left by 16 bits, and then ORed with the interval number of the layer to obtain a unique interval id.

[0073] Each quadruple in the quaternion table is assigned to different intervals in different layers based on time. Specifically, the time of each quadruple is first simplified to ensure that each time can be successfully assigned to the corresponding interval. This is done by: subtracting the start and end times from the minimum time, dividing by the difference between the maximum and minimum times, multiplying by the layer number (4), and rounding the result down; then, starting from the highest layer, intervals are selected. If the simplified start time *a* is odd, the quadruple is recorded in the *a*-th interval of the current layer, and *a* is incremented by 1; if the simplified end time *b* is even, the quadruple is recorded in the *b*-th interval of the current layer, and *b* is decremented by 1. This process is repeated until all layers are determined or the start time is greater than the end time, completing the quadruple assignment.

[0074] Furthermore, in terms of physical storage, a key-value index is constructed to record the association between the range and each quadruple in the quadruple table. The quadruples within the range are stored as a list. Using the range ID as the key and the list of quadruples within the range as the value, a key-value index is constructed to store the correspondence between the two.

[0075] In this embodiment, step S104, which constructs the association between the key-value index record feature set and the subject set containing the feature set, to accelerate the generation of temporal query results, specifically involves:

[0076] First, assign a unique identifier id to each feature set. Then, for each feature set, obtain the set of ids of the subject of that feature set. Finally, construct a key-value index to store the relationship between the two, using the feature set id as the key and the set of ids of the subject corresponding to that feature set as the value.

[0077] This invention also provides a method for querying temporal RDF data based on an extended feature set. Figure 3 This is a flowchart illustrating the temporal RDF data query method based on extended feature sets provided by the present invention; as shown below. Figure 3 As shown, the method is applied to query parsing and query execution of temporal RDF data, including:

[0078] Step S201: Receive and parse temporal query statements, and bind temporal constraints to each query pattern in the query graph;

[0079] Step S202: Extract the feature set, extended feature set, and extended feature set chain from the query pattern, and uniquely identify each feature set;

[0080] Step S203: Apply the feature set index, extended feature set index and range index to match each extended feature set chain, merge the result sets of the feature sets of each query pattern, and return the final result.

[0081] In this embodiment, in step S201, the query pattern is a triplet of the query statement, and the query graph is composed of all the triplets of the query statement. Temporal constraints include time and temporal constraint relationships, which include the 7 types in Table 1 and the inverse relationships of the first 6 types (the time intervals of the temporal constraint keywords are interchanged). [Ts,Te] and [T′s,T′e] represent the two time periods being compared. Temporal constraints are bound to the query pattern for matching subsequent query conditions. Each temporal constraint relationship is uniquely identified starting from 1.

[0082] Table 1

[0083] [Ts,Te]BEFORE[T′s,T′e] The <T′s [Ts,Te]MEETS[T′s,T′e] Te=T′s [Ts,Te]FINISHES[T′s,T′e] Ts>T′s and Te=T′e [Ts,Te]STARTS[T′s,T′e] Ts=T′s and Te<T′e [Ts,Te]DURING[T′s,T′e] Ts>T′s and Te<T′e [Ts,Te]OVERLAP[T′s,T′e] Ts<T′s<Te and Te<T′e [Ts,Te]EQUALS[T′s,T′e] Ts=T′s and Te=T′e

[0084] For each query pattern, use an array of length 7 to store the subject ID, predicate ID, object ID, start time integer expression, end time integer expression, tense constraint relationship ID, and the ID of the feature set to which it belongs.

[0085] In this embodiment, step S202, which involves extracting the feature set, extended feature set, and extended feature set chain from the query pattern, and uniquely identifying each feature set, specifically includes:

[0086] Retrieve the feature sets from the query patterns, assigning each feature set an integer number starting from 1. Even if two feature sets are identical, they will have different numbers. Then, use a seven-list to store the subject ID, predicate ID, object ID, integer form of the start time of the restriction, integer form of the end time of the restriction, the tense semantic keyword of the restriction, and the feature set number to which they belong for all query patterns.

[0087] Furthermore, the extended feature set and extended feature set chain are extracted from the query pattern through traversal.

[0088] In this embodiment, step S203 involves applying the feature set index, extended feature set index, and range index to match each extended feature set chain. The result sets of the feature sets from each query pattern are merged and connected, and the final result is returned. Specifically:

[0089] The extended feature set chains in the query pattern are matched one by one with the extended feature set chains in the dataset. Matching each extended feature set chain includes matching the subject and object feature sets of each extended feature set node. Feature set matching is performed using bit sets. If a bit in the feature set of the query pattern is 1, then the bit set of the feature set in the matching dataset must also have a value of 1 at that bit to pass the match. If a bit in the feature set of the query pattern is 0, then the bit set of the feature set in the matching dataset can pass the match regardless of whether the bit set is 1 or 0.

[0090] Furthermore, after the predicates of the feature set in the query pattern are matched with the predicates of the feature set in the index, temporal matching is performed on the query pattern to which the current predicate belongs. Specifically:

[0091] Obtain the start and end times of the query pattern;

[0092] Starting layer by layer, with layer number m, obtain the first m bits p of the binary number of the start time, shift layer number m to the left by 16 bits, and then perform a bitwise OR operation with p to obtain the interval number of the p-th interval of the m-th layer.

[0093] Apply the range index and perform nonvariable subject and object equality matching, as well as start and end time tense matching, on the quadruple records within the range and the query pattern.

[0094] Collect the subject IDs of the records that match, and repeatedly increment p by 1 to continue searching for matching subject IDs in the p-th interval of the current layer until p is greater than the first m bits of the binary number of the end time. The matching rules for the loop are the same as those described above.

[0095] Furthermore, the key-value index is used to retrieve the subject ID set of the feature set in the extended feature set index that has the current match, and the intersection of this set with the subject ID set that matches the tense is taken. The resulting subject ID is the subject ID of the query result. The result sets of all query patterns that have matched the feature sets are merged and joined to return the final query result.

[0096] The above description of the embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for indexing and querying temporal RDF data based on extended feature sets, applied to constructing indexes for temporal RDF data, characterized in that, include: Temporal RDF data is represented in quintuple format, extending the effective time for triplet relations; The key-value structure is applied to construct feature set indexes and extended feature set indexes for the triples part of temporal RDF. The predicate set of the feature set is represented by a bit set structure, with each bit set as a row, and the bit sets of all feature sets constitute a bitmap. The application of key-value structures to construct interval indexes for temporal RDF based on time information includes: vertically extracting each predicate from the bitmap, obtaining all quintuples with that predicate as the verb, and applying a quadruple table to store the subject ID, object ID, start time, and end time of each quintuple for each predicate; obtaining all quadruples for each predicate, determining the time range and constructing partitions based on the minimum and maximum times of the quadruple table; assigning each quadruple in the quadruple table to different intervals at different levels according to time; obtaining the interval ID corresponding to each interval; and using the interval ID as the key and all quadruples within the interval as the value, recording the association between each interval and all quadruples within the interval through a key-value index structure. Assign a unique identifier id to each feature set, and obtain the set of subject ids for each feature set. Construct a key-value index to record the association between the feature set and the set of subjects that have the feature set, using the feature set id as the key and the set of subject ids that have the feature set as the value. Parse the temporal query statements, bind temporal constraints to each query pattern in the query graph, and extract the feature set, extended feature set, and extended feature set chain from the query pattern; The query statement is matched using feature set index, extended feature set index and range index. This includes matching the extended feature set chain in the query pattern with the extended feature set chain in the dataset one by one. Each extended feature set node of the two extended feature set chains to be matched is matched sequentially. All matched extended feature set chains in the dataset are collected. The sequential matching of each extended feature set node in the two extended feature set chains to be matched includes: applying the bit set structure of the feature set index to perform bit-by-bit matching of the subject feature set and object feature set of the extended feature set; finding the corresponding interval using the interval index of the quadruple table corresponding to the current predicate based on the time interval constraint of the query pattern corresponding to each bit; traversing the quadruples in the interval, performing non-variable subject-object equivalence matching and temporal constraint matching one by one, and collecting the subject IDs of the matching records to form a temporal matching subject ID set; The key-value index is used to obtain the subject ID set of the feature set in the extended feature set index that has the current match, and the intersection of this set with the subject ID set that matches the tense is taken. The resulting subject ID is the subject ID of the query result. Merge and join the result sets of feature sets from various query patterns, and return the final result.

2. The temporal RDF data indexing and querying method based on extended feature sets according to claim 1, characterized in that, Temporal RDF data is represented in quintuple format, including: Based on the semantics of triplet, time is classified into two types: constant time and time interval, and the time information is converted into integers for representation and storage. For constant-time triples, retain their original triple format; For triples of time interval type, the time information includes start and end times, which can be expanded into a quintuple format.

3. The temporal RDF data indexing and querying method based on extended feature sets according to claim 1, characterized in that, The key-value structure is applied to construct feature set indexes and extended feature set indexes for the triples portion of temporal RDF, including: Parse temporal RDF 5-tuple data, extract the subject, predicate, and object, and convert the corresponding URI or string of the subject, predicate, and object into integer IDs and store them in an integer array; Obtain the feature set and extended feature set of the entire dataset, as well as the corresponding feature set ID and extended feature set ID; and parse out the extended feature set chain of the entire dataset; The predicate set of the feature set is represented by a bit set structure; The key-value structure is used to construct a feature set index with the feature set id as the key and the feature set bit set as the value; The extended feature set index is constructed using a key-value structure with the extended feature set id as the key and the extended feature set as the value.

4. The temporal RDF data indexing and querying method based on extended feature sets according to claim 1, characterized in that, The time range is determined and partitions are constructed based on the minimum and maximum times of the quaternion table, including: The time range is determined based on the minimum and maximum times of the quaternion list; Copy the time range into a preset number of copies, with each copy representing a layer; Each layer is divided into 2^x intervals, where x is the layer number.

5. The temporal RDF data indexing and querying method based on extended feature sets according to claim 4, characterized in that, Each quad in the quadruple table is assigned to different intervals at different levels based on time, including: The difference between the start and end times and the minimum time is calculated, then divided by the difference between the maximum and minimum times, multiplied by the number of floors x, and the result is rounded down. Starting from the highest level, select an interval. If the rounded start time 'a' is odd, record the quadruple in the 'a'th interval of the current level and increment 'a' by 1. If the rounded end time 'b' is even, record the quadruple in the 'b'th interval of the current level and decrement 'b' by 1. The selection process is repeated, and the layer number is decremented by 1 after each selection, until the layer number is less than 0 or the start time is greater than the end time, thus completing the allocation of the quadruple.

Citation Information

Patent Citations

  • Time sequence RDF data storage and query method based on bit matrix model

    CN114791967A