1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

""" 

:Author: Daniel Mohr 

:Email: daniel.mohr@dlr.de 

:Date: 2021-03-19 (last change). 

:License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007. 

""" 

 

 

def _includes_dict(analyse_object, content): 

""" 

:Author: Daniel Mohr 

:Date: 2021-02-26 

""" 

return bool(("@id" in analyse_object) and 

(analyse_object["@id"] == content)) 

 

 

def _includes_list(analyse_object, content): 

""" 

:Author: Daniel Mohr 

:Date: 2021-02-26 

""" 

ret = False 

for element in analyse_object: 

ret = _includes_dict(element, content) 

if ret: 

break 

return ret 

 

 

def _includes(analyse_object, content): 

""" 

:Author: Daniel Mohr 

:Date: 2021-02-26 

""" 

36 ↛ 38line 36 didn't jump to line 38, because the condition on line 36 was never false if isinstance(analyse_object, dict): 

return _includes_dict(analyse_object, content) 

if isinstance(analyse_object, list): 

return _includes_list(analyse_object, content) 

# else: 

return False 

 

 

def ispending(analyse_object): 

""" 

:Author: Daniel Mohr 

:Date: 2021-03-09 

 

We ignore work-in-progress terms marked as pending: 

https://schema.org/docs/howwework.html#pending 

""" 

if "schema:isPartOf" in analyse_object: 

return _includes(analyse_object["schema:isPartOf"], 

"https://pending.schema.org") 

return False