Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
faa1dc56
Unverified
Commit
faa1dc56
authored
Jul 30, 2020
by
xiang song(charlie.song)
Committed by
GitHub
Jul 30, 2020
Browse files
hot fix (#1888)
Co-authored-by:
Ubuntu
<
ubuntu@ip-172-31-51-214.ec2.internal
>
parent
aee10679
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
python/dgl/data/rdf.py
python/dgl/data/rdf.py
+7
-7
No files found.
python/dgl/data/rdf.py
View file @
faa1dc56
...
...
@@ -610,13 +610,13 @@ class AIFBDataset(RDFGraphDataset):
def
parse_entity
(
self
,
term
):
if
isinstance
(
term
,
rdf
.
Literal
):
return
Entity
(
id
=
str
(
term
),
cls
=
"_Literal"
)
return
Entity
(
e_
id
=
str
(
term
),
cls
=
"_Literal"
)
if
isinstance
(
term
,
rdf
.
BNode
):
return
None
entstr
=
str
(
term
)
if
entstr
.
startswith
(
self
.
entity_prefix
):
sp
=
entstr
.
split
(
'/'
)
return
Entity
(
id
=
sp
[
5
],
cls
=
sp
[
3
])
return
Entity
(
e_
id
=
sp
[
5
],
cls
=
sp
[
3
])
else
:
return
None
...
...
@@ -732,7 +732,7 @@ class MUTAGDataset(RDFGraphDataset):
def
parse_entity
(
self
,
term
):
if
isinstance
(
term
,
rdf
.
Literal
):
return
Entity
(
id
=
str
(
term
),
cls
=
"_Literal"
)
return
Entity
(
e_
id
=
str
(
term
),
cls
=
"_Literal"
)
elif
isinstance
(
term
,
rdf
.
BNode
):
return
None
entstr
=
str
(
term
)
...
...
@@ -744,7 +744,7 @@ class MUTAGDataset(RDFGraphDataset):
cls
=
'bond'
else
:
cls
=
None
return
Entity
(
id
=
inst
,
cls
=
cls
)
return
Entity
(
e_
id
=
inst
,
cls
=
cls
)
else
:
return
None
...
...
@@ -881,7 +881,7 @@ class BGSDataset(RDFGraphDataset):
# instance
cls
=
'%s/%s'
%
(
sp
[
4
],
sp
[
5
])
inst
=
sp
[
6
]
return
Entity
(
id
=
inst
,
cls
=
cls
)
return
Entity
(
e_
id
=
inst
,
cls
=
cls
)
else
:
return
None
...
...
@@ -1006,7 +1006,7 @@ class AMDataset(RDFGraphDataset):
if
isinstance
(
term
,
rdf
.
Literal
):
return
None
elif
isinstance
(
term
,
rdf
.
BNode
):
return
Entity
(
id
=
str
(
term
),
cls
=
'_BNode'
)
return
Entity
(
e_
id
=
str
(
term
),
cls
=
'_BNode'
)
entstr
=
str
(
term
)
if
entstr
.
startswith
(
self
.
entity_prefix
):
sp
=
entstr
.
split
(
'/'
)
...
...
@@ -1018,7 +1018,7 @@ class AMDataset(RDFGraphDataset):
else
:
cls
=
'TYPE'
inst
=
spp
return
Entity
(
id
=
inst
,
cls
=
cls
)
return
Entity
(
e_
id
=
inst
,
cls
=
cls
)
else
:
return
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment