CN116108112A - Method and device for converting OWL data into graph data and electronic equipment - Google Patents

Method and device for converting OWL data into graph data and electronic equipment Download PDF

Info

Publication number
CN116108112A
CN116108112A CN202211610753.5A CN202211610753A CN116108112A CN 116108112 A CN116108112 A CN 116108112A CN 202211610753 A CN202211610753 A CN 202211610753A CN 116108112 A CN116108112 A CN 116108112A
Authority
CN
China
Prior art keywords
owl
data
type
instance
relationship
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211610753.5A
Other languages
Chinese (zh)
Inventor
殷亮
赵超
肖新光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Antiy Technology Group Co Ltd
Original Assignee
Antiy Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Antiy Technology Group Co Ltd filed Critical Antiy Technology Group Co Ltd
Priority to CN202211610753.5A priority Critical patent/CN116108112A/en
Publication of CN116108112A publication Critical patent/CN116108112A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a conversion method, a device and electronic equipment for converting OWL data into graph data, wherein the method comprises the following steps: analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances; based on the analyzed type parameters, establishing an association relationship between OWL examples; converting each OWL instance into vertex data, and converting the association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data. According to the scheme, the OWL data in the created OWL data knowledge base can be converted into the graph data, so that the creation cost of the graph data is saved, and the resource waste is avoided.

Description

Method and device for converting OWL data into graph data and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a conversion method, a device and electronic equipment for converting OWL data into graph data.
Background
OWL data is developed from an ontology language, and an OWL data knowledge base can be constructed through an ontology modeling tool software. With the rapid development of graph database technology, it is necessarily a trend to store ontology data with graph data. However, the existing OWL data and the graph data are not compatible, and for an OWL data knowledge base which is constructed with a great deal of cost, the OWL data cannot be converted into the graph data, so that the resource cost is wasted. Accordingly, it is desirable to provide a method capable of converting OWL data into graph data.
Disclosure of Invention
The embodiment of the invention provides a method, a device and electronic equipment for converting OWL data into graph data, which can realize the conversion from OWL data to graph data so as to reduce the waste of resource cost.
In a first aspect, an embodiment of the present invention provides a method for converting OWL data into graph data, including:
analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
based on the analyzed type parameters, establishing an association relationship between OWL examples;
converting each OWL instance into vertex data, and converting the association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
In one possible implementation manner, before the parsing the type parameter of the corresponding type from each OWL node data, the method further includes:
converting OWL node data into triplet data including subject, predicate and object; and judging the type of the corresponding OWL node data based on the subject in the converted triplet data.
In one possible implementation manner, the parsing the type parameter of the corresponding type from each OWL node data includes:
when the type of the OWL node data is an OWL attribute, the type parameters of the corresponding type include: at least one of attribute number, attribute name, attribute value, and parent attribute;
when the type of the OWL node data is an OWL class, the type parameters of the corresponding type include: at least one of class number, class name, parent class, and attribute number;
when the type of the OWL node data is an OWL relationship, the type parameters of the corresponding type include: at least one of a relationship number, a relationship name, a parent relationship, a number of a relationship arrow connection start point, and a number of a relationship arrow connection target point;
when the type of the OWL node data is an OWL instance, the type parameters of the corresponding type include: at least one of an instance number, an instance name, and an association number.
In one possible implementation, the association number includes an attribute number, a class number, and a relationship number;
the establishing of the association relationship between the OWL examples based on the analyzed type parameters comprises the following steps:
for each OWL instance, perform: determining a relationship list associated with the OWL instance based on the association number included in the type parameter of the OWL instance; and determining other OWL instances associated with the OWL instance and association relations between the OWL instance and the other OWL instances according to the type parameter of each target relationship in the relationship list.
In one possible implementation, the method further includes: for each OWL instance, determining a parent class of the OWL instance and a list of attributes associated with the OWL instance based on an association number included in a type parameter of the OWL instance;
the converting each OWL instance into vertex data includes: and generating corresponding vertex data according to the parent class of the OWL instance and each attribute associated with the OWL instance.
In one possible implementation, the method further includes:
constructing a rule Schema statement of the graph database based on the analyzed type parameters;
and creating a corresponding graph database according to the graph data formed after conversion and the rule Schema statement.
In one possible implementation manner, the rule Schema statement for constructing the graph database based on the parsed type parameter includes:
generating an attribute Schema statement based on the type parameters of the OWL attribute, generating a node Schema statement and an index Schema statement based on the type parameters of the OWL class, and generating an edge Schema statement based on the type parameters of the OWL relation;
the attribute Schema statement, the node Schema statement, the index Schema statement and the edge Schema statement are integrated into a rule Schema statement for characterizing the rules of the graph database.
In a second aspect, an embodiment of the present invention further provides an apparatus for converting OWL data into graph data, including:
the analyzing unit is used for analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
the relationship establishing unit is used for establishing the association relationship between OWL examples based on the analyzed type parameters;
the conversion unit is used for converting each OWL instance into vertex data and converting the association relationship between the two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of the present specification is implemented.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform a method according to any of the embodiments of the present specification.
The embodiment of the invention provides a method, a device and electronic equipment for converting OWL data into graph data, which are used for analyzing type parameters of types such as OWL attributes, OWL classes, OWL relations, OWL examples and the like by analyzing each OWL node in an OWL data knowledge base, further establishing the relations among the OWL examples based on the analyzed type parameters, converting each OWL example into vertex data in the graph data, and converting the association relation between two OWL examples into edge data between the two OWL examples in the graph data. Therefore, in the scheme, the OWL data in the created OWL data knowledge base can be converted into the graph data, so that the creation cost of the graph data is saved, and the resource waste is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for converting OWL data into graph data according to an embodiment of the present invention;
FIG. 2 is a hardware architecture diagram of an electronic device according to an embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for converting OWL data into map data according to an embodiment of the present invention;
FIG. 4 is a block diagram of another apparatus for converting OWL data into graph data according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
As described above, the OWL data is not compatible with the graph data, and the OWL data cannot be converted into the graph data. To avoid wasting the OWL data knowledge base that has been built at a significant cost, it is desirable to provide a method that can convert OWL data into graph data.
Through analysis, the OWL data comprise contents such as examples, attributes, classes, relations and the like, and the graph data comprises vertex data and edge data, wherein the vertex data are example nodes in the graph, namely correspond to the examples in the OWL data, and the edge data are used for representing the relations between the two example nodes, so that the association relations between the OWL examples need to be combed out from the OWL data, and further the conversion from the OWL data to the graph data can be realized.
Specific implementations of the above concepts are described below.
Referring to fig. 1, an embodiment of the present invention provides a method for converting OWL data into graph data, where the method includes:
step 100, analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
102, establishing an association relationship between OWL examples based on the analyzed type parameters;
step 104, converting each OWL instance into vertex data, and converting the association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
In the embodiment of the invention, each OWL node in the OWL data knowledge base is analyzed to analyze type parameters of the types such as OWL attribute, OWL class, OWL relationship, OWL instance and the like, so that the relationship between the OWL instances is established based on the analyzed type parameters, each OWL instance is converted into vertex data in the graph data, and the association relationship between the two OWL instances is converted into edge data between the two OWL instances in the graph data. Therefore, in the scheme, the OWL data in the created OWL data knowledge base can be converted into the graph data, so that the creation cost of the graph data is saved, and the resource waste is avoided.
The manner in which the individual steps shown in fig. 1 are performed is described below.
First, for step 100, based on the loaded OWL data knowledge base, the type parameters of the corresponding type are parsed from each OWL node data.
The OWL data knowledge base is constructed and completed, and contains a large amount of OWL node data, and can correspond to different fields, such as social networks, enterprise information inquiry, advertisement recommendation, anti-black reconnaissance, financial sealing control, antivirus, big data security management, meta universe and the like.
When the OWL data knowledge base is loaded, the OWL data knowledge base can be read into the memory by calling an OWL operation API. It will be appreciated that batch reading may be employed if the content of the OWL data knowledge base is large.
The types of data for different OWL nodes may be different. In an embodiment of the present invention, the types may include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances.
Since the contents characterized by the OWL node data of different types are different, the type of the OWL node data needs to be determined. In one embodiment of the invention, as the most basic constituent units of the knowledge graph are triples, the OWL node data can be converted into triples data comprising subjects, predicates and objects before analyzing the type parameters of the corresponding types from each OWL node data; and judging the type of the corresponding OWL node data based on the subject in the converted triplet data.
Specifically, if the subject is "OWL: datatype property", the type of OWL node data is OWL attribute; if the subject is 'OWL: class', the type of the OWL node data is OWL Class; if the subject is 'OWL: objectProperty', the type of the OWL node data is OWL relationship; if the main language is 'OWL: namedIndinvidual', the type of the OWL node data is an OWL instance.
By converting the OWL node data into the triples, the OWL node data can be rapidly judged based on the subject, and analysis of type parameters can be further realized based on the converted triples, so that the analysis speed is higher, and the analysis result is more accurate.
In the embodiment of the invention, when analyzing the type parameters of the OWL node data, the analyzed type parameters of the OWL node data of different types are different, and four types of OWL attributes, OWL classes, OWL relations and OWL examples are respectively described below.
1. OWL attribute
When the type of the OWL node data is an OWL attribute, the type parameters of the corresponding type include: at least one of attribute number, attribute name, attribute value, and parent attribute.
For example, when OWL node data is converted into triplet data, the following are included:
webprotege:R8PecQtpAfUbFJOXAkjgxfx rdf:type owl:DatatypeProperty;
rdfs:subPropertyof webprotege:R7HhgK4LKmVCmSITBATtfk;
rdfs: label "Microsoft number".
Wherein, "ow1: datatype property" is used to characterize the type of the OWL node data as OWL attribute, "webpage: R8 pecqtpaftubfjoxakjgxfx" is an attribute number, "rdfs: subPropertyof webprotege: R7HhgK4 lkmvvcmsituttfk" is used to characterize the number of the parent attribute of the attribute, "rdfs:1 abe" microsoft number "and" characterization attribute name is "microsoft number".
2. OWL class
When the type of the OWL node data is an OWL class, the type parameters of the corresponding type include: at least one of class number, class name, parent class, and attribute number.
For example, when OWL node data is converted into triplet data, the following are included:
webprotege:R7cn62Ud4WBZU1h35iofxUe rdf:type owl:Class;
rdfs:subClassOf webprotege:RCz96sb7bpGTdFgksiLvx9A;
rdfs: label "local user account".
Wherein, the type of the OWL node data is represented by "rdf: type OWL: class". For the OWL node data, the type of the OWL node data is represented by "webpage: R7cn62Ud4WBZU1h35iofxUe" is represented by the Class number, "rdfs: subClassOf webprotege: RCz sb7 bpgtdfgskilvx 9A" for the parent Class number of the Class ". For the rdfs:1abe1 "local user account" and "characterization class name" local user account ".
3. OWL relationship
When the type of the OWL node data is an OWL relationship, the type parameters of the corresponding type include: at least one of a relationship number, a relationship name, a parent relationship, a number of a relationship arrow connection start point, and a number of a relationship arrow connection target point.
For example, when OWL node data is converted into triplet data, the following are included:
webprotege:R7PqwcUrjrwNgwgBgaA7BzI rdf:type owl:ObjectProperty;
rdfs:subPropertyof webprotege:R85VwQHYSwSBbW9zEF5Cs91;
rdfs: label "connection".
Wherein, "OWL: objectProperty" is used to characterize the type of the OWL node data as an OWL relationship, "webpage: R7PqwcUrjrwNgwgBgaA7BzI" is a relationship number, "rdfs: subPropertyof webprotege: R85vwQHYSwSBBW9zEF Cs91" is used to characterize the number of the parent relationship of the relationship, "rdfs: label" connection "is used to characterize the relationship name as" connection ".
4. OWL instance
When the type of the OWL node data is an OWL instance, the type parameters of the corresponding type include: at least one of an instance number, an instance name, and an association number.
For example, when OWL node data is converted into triplet data, the following are included:
webprotege RZe1hhdnfgSDODmTozuP1g rdf:type owl:NamedIndividual
webprotege:Rt2yaDAB6mIW1qIR MLKfJL;
webprotege:R7PqwcUrjrWgwgBg aA7BzI
webprotege:RDQOF9GYoB3564P2jP79gMV,
webprotege:RDqd28N1p4iEf4s1J3FT4I9;
rdfs:1abe1 "switch a".
Wherein, "owl: namedIndinvidual "is used for representing the type of the OWL node data and is an OWL instance," webpage RZe1 hhdngfSDODmTOP 1g "is an instance number," webpage: rt2yaDAB6mIW qIRMLKfJL "," webpage: R7 PqwcUrWgwgbgA 7BzI "," webpage: RDQOF9GYoB3564P2jP gMV "and" webpage: RDqd28N1P4iEf s1J3FT4I9 "are all associated numbers corresponding to the instance, and the associated numbers can be attribute numbers, class numbers and relationship numbers; "rdfs:1abe "switch a" and "characterizing instance name" switch a ".
It should be noted that each of the above examples is an example in practical application, and the type parameters related to the above examples may also include other types of parameters.
Then, for step 102, based on the analyzed type parameters, an association relationship between OWL instances is established.
To enable the conversion of OWL data into graph data, it is necessary to find commonalities between the two. First, the relation of each type in OWL data is as follows: the OWL attribute belongs to an OWL class, the OWL instance derives from the OWL class, OWL relations exist among the OWL instances, and the OWL instance is formed after the attribute value of the OWL attribute is filled. Then, the graph data includes vertex data and edge data, wherein the vertex data is used for forming an instance node in the graph, namely, an OWL instance in the corresponding OWL data, and the OWL attribute and the OWL class can be used as descriptive information for the OWL instance.
In one embodiment of the present invention, the association relationship between OWL instances may be established by:
for each OWL instance, perform: determining a relationship list associated with the OWL instance based on the association number included in the type parameter of the OWL instance; and determining other OWL instances associated with the OWL instance and association relations between the OWL instance and the other OWL instances according to the type parameter of each target relationship in the relationship list.
After the analysis of all OWL node data in the OWL data knowledge base is completed, instance numbers based on OWL instances can form instance sets, attribute sets based on OWL attributes can be formed, class sets based on OWL classes can be formed, and relationship numbers based on OWL relationships can form relationship sets. Therefore, in the embodiment of the invention, the association relationship of each OWL instance can be confirmed by traversing the instance set.
When the association relation of the current OWL instance is confirmed, because the association number in the type parameter of the OWL instance comprises one or more relation numbers, the one or more relation numbers can be stored in a list, so that a relation list associated with the OWL instance is formed. Further, since the type parameter of the OWL relationship includes the number of the connection start point of the relationship arrow and the number of the connection target point of the relationship arrow, other OWL instances having an association relationship with the OWL instance can be determined based on the type parameter of each target relationship in the relationship list, and the type parameter of the OWL relationship further includes a relationship name, so that the association relationship between the OWL instance and the other OWL instances can be determined.
In addition, since the association number in the type parameter of the OWL instance further includes the attribute number and the class number, the parent class of the OWL instance and the attribute list associated with the OWL instance may be determined for each OWL instance based on the association number included in the type parameter of the OWL instance; specifically, a parent class to which the OWL instance belongs may be determined based on the class number, and an attribute list of the OWL instance may be determined based on the attribute number, where the parent class to which the OWL instance belongs and each attribute in the attribute list of the OWL instance may be used as description information of the OWL instance, so as to facilitate conversion into subsequent vertex data.
Further, according to the parent class to which the OWL instances belong, all the OWL instances belonging to the same parent class can be determined, and further, the OWL instances belonging to the same parent class can be determined as the same class instance.
Finally, for step 104, converting each OWL instance into vertex data, and converting the association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
From the preamble analysis, the OWL instance may be used as an instance node in the graph data, and thus, corresponding vertex data may be generated according to the parent class of the OWL instance and the attributes associated with the OWL instance. In particular, when vertex data is generated, corresponding vertex data sentences may be created based on such information, so that a graph database can be quickly created later.
Since the OWL instances may be used as instance nodes in the graph data, and the edge data of the graph data is used to represent the association relationship between two instance nodes, for the association relationship between the OWL instances established in step 102, the edge data between any two OWL instances having the association relationship may be formed. Similarly, when generating edge data, corresponding edge data sentences can be created based on the information so that a graph database can be quickly created later.
Further, the vertex data statement and the side data statement are combined to form a graph data creation statement.
The conversion from OWL data to graph data is completed.
After the graph data is obtained, the graph data may be exported to a graph database so that the graph data can be managed uniformly. Thus, it may further comprise: constructing a rule Schema statement of the graph database based on the analyzed type parameters; and creating a corresponding graph database according to the graph data formed after conversion and the rule Schema statement.
Wherein the rule Schema statement is used to characterize the generation rules of the graph data in the graph database, and the generation rules are derived from the OWL data knowledge base. Specifically, the rule Schema statement for constructing the graph database based on the parsed type parameters may include:
generating an attribute Schema statement based on the type parameters of the OWL attribute, generating a node Schema statement and an index Schema statement based on the type parameters of the OWL class, and generating an edge Schema statement based on the type parameters of the OWL relation;
the attribute Schema statement, the node Schema statement, the index Schema statement and the edge Schema statement are integrated into a rule Schema statement for characterizing the rules of the graph database.
The attribute Schema statement is generated based on the type parameters of the parsed OWL attribute, such as attribute number, attribute name, attribute value, data type, length, whether to fill in, etc. The node Schema statement and the index Schema statement are generated based on the type parameters of the OWL class which is already parsed, such as class number, class name, attribute list, whether the attribute can be empty, etc., wherein the index Schema statement is used for facilitating the retrieval of data. The edge Schema statement is generated based on the type parameters of the already parsed OWL relationship, such as a relationship number, a relationship name, a start point number, a target point number, a connection direction, whether it can be repeated, etc. After the Schema sentences are generated, the Schema sentences are integrated together to form the rule Schema sentences of the graph database.
When creating the graph database, the graph data formed after conversion and the rule Schema statement can be exported to form a corresponding graph database file, and the graph database can be created by using the file. The manner in which the graph database is created using graph data and rule Schema statements is prior art and will not be described in detail herein.
As shown in fig. 2 and 3, the embodiment of the invention provides a device for converting OWL data into graph data. The apparatus embodiments may be implemented by software, or may be implemented by hardware or a combination of hardware and software. In terms of hardware, as shown in fig. 2, a hardware architecture diagram of an electronic device where an apparatus for converting OWL data into graph data is located according to an embodiment of the present invention is shown, where the electronic device where the apparatus is located in the embodiment may generally include other hardware, such as a forwarding chip responsible for processing a packet, in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 2. Taking a software implementation as an example, as shown in fig. 3, the device in a logic sense is formed by reading a corresponding computer program in a nonvolatile memory into a memory by a CPU of an electronic device where the device is located and running the computer program. The device for converting OWL data into graph data provided in this embodiment includes:
the parsing unit 301 is configured to parse type parameters of a corresponding type from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
a relationship establishing unit 302, configured to establish an association relationship between OWL instances based on the analyzed type parameter;
a conversion unit 303, configured to convert each OWL instance into vertex data, and convert an association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
In one embodiment of the present invention, the parsing unit is further configured to convert OWL node data into triplet data including subject, predicate and object; and judging the type of the corresponding OWL node data based on the subject in the converted triplet data.
In one embodiment of the present invention, the parsing unit is specifically configured to, when parsing a type parameter of a corresponding type from each OWL node data:
when the type of the OWL node data is an OWL attribute, the type parameters of the corresponding type include: at least one of attribute number, attribute name, attribute value, and parent attribute;
when the type of the OWL node data is an OWL class, the type parameters of the corresponding type include: at least one of class number, class name, parent class, and attribute number;
when the type of the OWL node data is an OWL relationship, the type parameters of the corresponding type include: at least one of a relationship number, a relationship name, a parent relationship, a number of a relationship arrow connection start point, and a number of a relationship arrow connection target point;
when the type of the OWL node data is an OWL instance, the type parameters of the corresponding type include: at least one of an instance number, an instance name, and an association number.
In one embodiment of the present invention, the association number includes an attribute number, a class number, and a relationship number;
the relationship establishing unit is specifically configured to: for each OWL instance, perform: determining a relationship list associated with the OWL instance based on the association number included in the type parameter of the OWL instance; and determining other OWL instances associated with the OWL instance and association relations between the OWL instance and the other OWL instances according to the type parameter of each target relationship in the relationship list.
In one embodiment of the present invention, the parsing unit may be further configured to determine, for each OWL instance, a parent class of the OWL instance and a list of attributes associated with the OWL instance based on an association number included in a type parameter of the OWL instance;
the conversion unit is specifically configured to generate corresponding vertex data according to a parent class of each OWL instance and each attribute associated with the OWL instance when converting each OWL instance into vertex data.
In one embodiment of the present invention, referring to fig. 4, the apparatus may further include:
a Schema construction unit 304, configured to construct a rule Schema statement of the graph database based on the parsed type parameter;
and the graph database creation unit 305 is configured to create a corresponding graph database according to the graph data formed after conversion and the rule Schema statement.
In one embodiment of the present invention, the Schema construction unit is specifically configured to: generating an attribute Schema statement based on the type parameters of the OWL attribute, generating a node Schema statement and an index Schema statement based on the type parameters of the OWL class, and generating an edge Schema statement based on the type parameters of the OWL relation; the attribute Schema statement, the node Schema statement, the index Schema statement and the edge Schema statement are integrated into a rule Schema statement for characterizing the rules of the graph database.
It will be appreciated that the architecture illustrated in the embodiments of the present invention is not intended to be limiting in terms of a specific means for converting OWL data into graph data. In other embodiments of the invention, an apparatus for converting OWL data into graph data may include more or fewer components than shown, or certain components may be combined, certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the modules in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
The embodiment of the invention also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method for converting OWL data into graph data in any embodiment of the invention when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, and the computer program when being executed by a processor, causes the processor to execute the method for converting OWL data into graph data in any embodiment of the invention.
Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion module connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion module is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
It is noted that relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of additional identical elements in a process, method, article or apparatus that comprises the element.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: various media in which program code may be stored, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of converting OWL data into graph data, comprising:
analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
based on the analyzed type parameters, establishing an association relationship between OWL examples;
converting each OWL instance into vertex data, and converting the association relationship between two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
2. The method of claim 1, further comprising, prior to said parsing out the type parameters for the respective type from each OWL node data:
converting OWL node data into triplet data including subject, predicate and object; and judging the type of the corresponding OWL node data based on the subject in the converted triplet data.
3. The method of claim 1, wherein parsing the type parameter of the corresponding type from each OWL node data comprises:
when the type of the OWL node data is an OWL attribute, the type parameters of the corresponding type include: at least one of attribute number, attribute name, attribute value, and parent attribute;
when the type of the OWL node data is an OWL class, the type parameters of the corresponding type include: at least one of class number, class name, parent class, and attribute number;
when the type of the OWL node data is an OWL relationship, the type parameters of the corresponding type include: at least one of a relationship number, a relationship name, a parent relationship, a number of a relationship arrow connection start point, and a number of a relationship arrow connection target point;
when the type of the OWL node data is an OWL instance, the type parameters of the corresponding type include: at least one of an instance number, an instance name, and an association number.
4. A method according to claim 3, wherein the association number comprises an attribute number, a class number and a relationship number;
the establishing of the association relationship between the OWL examples based on the analyzed type parameters comprises the following steps:
for each OWL instance, perform: determining a relationship list associated with the OWL instance based on the association number included in the type parameter of the OWL instance; and determining other OWL instances associated with the OWL instance and association relations between the OWL instance and the other OWL instances according to the type parameter of each target relationship in the relationship list.
5. A method according to claim 3, further comprising: for each OWL instance, determining a parent class of the OWL instance and a list of attributes associated with the OWL instance based on an association number included in a type parameter of the OWL instance;
the converting each OWL instance into vertex data includes: and generating corresponding vertex data according to the parent class of the OWL instance and each attribute associated with the OWL instance.
6. The method of any one of claims 1-5, further comprising:
constructing a rule Schema statement of the graph database based on the analyzed type parameters;
and creating a corresponding graph database according to the graph data formed after conversion and the rule Schema statement.
7. The method of claim 6, wherein constructing a rule Schema statement of a graph database based on the parsed type parameters comprises:
generating an attribute Schema statement based on the type parameters of the OWL attribute, generating a node Schema statement and an index Schema statement based on the type parameters of the OWL class, and generating an edge Schema statement based on the type parameters of the OWL relation;
the attribute Schema statement, the node Schema statement, the index Schema statement and the edge Schema statement are integrated into a rule Schema statement for characterizing the rules of the graph database.
8. An apparatus for converting OWL data into graph data, comprising:
the analyzing unit is used for analyzing type parameters of corresponding types from each OWL node data based on the loaded OWL data knowledge base; the types include: at least one of OWL attributes, OWL classes, OWL relationships, and OWL instances;
the relationship establishing unit is used for establishing the association relationship between OWL examples based on the analyzed type parameters;
the conversion unit is used for converting each OWL instance into vertex data and converting the association relationship between the two OWL instances into edge data between the two OWL instances; wherein the vertex data and the edge data are combined to form graph data.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method of any of claims 1-7 when the computer program is executed.
10. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-7.
CN202211610753.5A 2022-12-14 2022-12-14 Method and device for converting OWL data into graph data and electronic equipment Pending CN116108112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211610753.5A CN116108112A (en) 2022-12-14 2022-12-14 Method and device for converting OWL data into graph data and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211610753.5A CN116108112A (en) 2022-12-14 2022-12-14 Method and device for converting OWL data into graph data and electronic equipment

Publications (1)

Publication Number Publication Date
CN116108112A true CN116108112A (en) 2023-05-12

Family

ID=86266611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211610753.5A Pending CN116108112A (en) 2022-12-14 2022-12-14 Method and device for converting OWL data into graph data and electronic equipment

Country Status (1)

Country Link
CN (1) CN116108112A (en)

Similar Documents

Publication Publication Date Title
Oriol et al. Quality models for web services: A systematic mapping
US8117233B2 (en) Method and system for message-oriented semantic web service composition based on artificial intelligence planning
US8489474B2 (en) Systems and/or methods for managing transformations in enterprise application integration and/or business processing management environments
US9020872B2 (en) Detecting missing rules with most general conditions
US20170024431A1 (en) Generating and executing query language statements from natural language
CN110673839B (en) Distributed tool configuration construction generation method and system
Brabra et al. On semantic detection of cloud API (anti) patterns
Gómez-Berbís et al. SEDIT: semantic digital twin based on industrial IoT data management and knowledge graphs
Grigori et al. Behavioral matchmaking for service retrieval: Application to conversation protocols
US10489024B2 (en) UI rendering based on adaptive label text infrastructure
US20230028947A1 (en) Cost-aware integration process modeling in multi-cloud computing environment
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN109189395B (en) Data analysis method and device
CN104320312A (en) Network application safety test tool and fuzz test case generation method and system
CN112287114A (en) Knowledge graph service processing method and device
EP2921986B1 (en) A system and method for evaluating a reverse query
CN115599386A (en) Code generation method, device, equipment and storage medium
JP2006302085A (en) Profile management device and computer program
CN116483850A (en) Data processing method, device, equipment and medium
CN112883088B (en) Data processing method, device, equipment and storage medium
EP2711838A1 (en) Documentation parser
CN113672233B (en) Server out-of-band management method, device and equipment based on Redfish
Liang et al. Service mining for Web service composition
CN116108112A (en) Method and device for converting OWL data into graph data and electronic equipment
Ornelas et al. Provenance data discovery through Semantic Web resources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination