Skip to content

Ac 183 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ clean:
@$(MAKE) \
--directory tests \
clean
@rm -f \
.git_submodule_init.done.log
@#Remove flag files that are normally set after deeper submodules and rdf-toolkit are downloaded.
@rm -f \
dependencies/CASE-Examples-QC/.git_submodule_init.done.log \
dependencies/CASE-Examples-QC/.lib.done.log

distclean: \
clean
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ This project follows [SEMVER 2.0.0](https://semver.org/) where versions are decl

This repository supports the ontology versions that are linked as submodules in the [CASE Examples QC](https://github.com/ajnelson-nist/CASE-Examples-QC) repository. Currently, the ontology versions are:

* CASE - 0.3.0
* UCO - 0.5.0
* CASE - 0.4.0
* UCO - 0.6.0


## Repository locations
Expand Down
4 changes: 2 additions & 2 deletions case_utils/case_file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_file_node(graph, filepath, node_iri=None, node_prefix=DEFAULT_PREFIX,
graph.add((
n_file_facet,
NS_UCO_OBSERVABLE.sizeInBytes,
rdflib.Literal(file_stat.st_size, datatype=NS_XSD.long)
rdflib.Literal(int(file_stat.st_size))
))
graph.add((
n_file,
Expand Down Expand Up @@ -174,7 +174,7 @@ def create_file_node(graph, filepath, node_iri=None, node_prefix=DEFAULT_PREFIX,
graph.add((
n_contentdata_facet,
NS_UCO_OBSERVABLE.sizeInBytes,
rdflib.Literal(successful_hashdict["filesize"], datatype=NS_XSD.long)
rdflib.Literal(successful_hashdict["filesize"])
))

# Add confirmed hashes into graph.
Expand Down
2 changes: 1 addition & 1 deletion dependencies/CASE-Examples-QC
Submodule CASE-Examples-QC updated 138 files
4 changes: 1 addition & 3 deletions tests/case_file/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ tests_srcdir := $(top_srcdir)/tests

qc_srcdir := $(top_srcdir)/dependencies/CASE-Examples-QC

case_srcdir := $(qc_srcdir)/dependencies/CASE-Examples/dependencies/CASE

RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar
RDF_TOOLKIT_JAR := $(qc_srcdir)/dependencies/CASE-Examples/dependencies/CASE-0.3.0/CASE/lib/rdf-toolkit.jar

COMM ?= $(shell which gcomm 2>/dev/null || which comm)
ifeq ($(COMM),)
Expand Down
6 changes: 3 additions & 3 deletions tests/case_file/kb.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@value": "2010-01-02T03:04:56+00:00"
},
"uco-observable:sizeInBytes": {
"@type": "xsd:long",
"@type": "xsd:integer",
"@value": "4"
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@
}
],
"uco-observable:sizeInBytes": {
"@type": "xsd:long",
"@type": "xsd:integer",
"@value": "4"
}
},
Expand All @@ -89,7 +89,7 @@
"@value": "2010-01-02T03:04:56+00:00"
},
"uco-observable:sizeInBytes": {
"@type": "xsd:long",
"@type": "xsd:integer",
"@value": "4"
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/case_file/kb.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d
a uco-observable:FileFacet ;
uco-observable:fileName "sample.txt" ;
uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
] ;
.

Expand Down Expand Up @@ -45,13 +45,13 @@ kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d
uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
]
;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
] ,
[
a uco-observable:FileFacet ;
uco-observable:fileName "sample.txt" ;
uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
]
;
.
Expand Down
2 changes: 1 addition & 1 deletion tests/case_file/sample.txt-disable_hashes.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d
a uco-observable:FileFacet ;
uco-observable:fileName "sample.txt" ;
uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
] ;
.

12 changes: 3 additions & 9 deletions tests/case_file/sample.txt-nocompact.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
"@id": "_:Na99d1f2a83814ac491c9b02662ea8587"
}
],
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": {
"@type": "http://www.w3.org/2001/XMLSchema#long",
"@value": "4"
}
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4
},
{
"@id": "_:Nad6171b4933a4a84b83faa5d48fd4ddb",
Expand Down Expand Up @@ -101,10 +98,7 @@
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
"@value": "2010-01-02T03:04:56+00:00"
},
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": {
"@type": "http://www.w3.org/2001/XMLSchema#long",
"@value": "4"
}
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4
}
]
}
}
12 changes: 3 additions & 9 deletions tests/case_file/sample.txt.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
"@id": "_:N77e79676ee5449ea9f6db813fb9dc095"
}
],
"uco-observable:sizeInBytes": {
"@type": "xsd:long",
"@value": "4"
}
"uco-observable:sizeInBytes": 4
},
{
"@id": "_:N839986b2d63a4963beafbb65016449da",
Expand Down Expand Up @@ -101,10 +98,7 @@
"@type": "xsd:dateTime",
"@value": "2010-01-02T03:04:56+00:00"
},
"uco-observable:sizeInBytes": {
"@type": "xsd:long",
"@value": "4"
}
"uco-observable:sizeInBytes": 4
}
]
}
}
4 changes: 2 additions & 2 deletions tests/case_file/sample.txt.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d
uco-types:hashValue "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"^^xsd:hexBinary ;
]
;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
] ,
[
a uco-observable:FileFacet ;
uco-observable:fileName "sample.txt" ;
uco-observable:modifiedTime "2010-01-02T03:04:56+00:00"^^xsd:dateTime ;
uco-observable:sizeInBytes "4"^^xsd:long ;
uco-observable:sizeInBytes "4"^^xsd:integer ;
]
;
.
Expand Down