Skip to content

Commit 576c2ed

Browse files
author
Larry Holder
committed
Changed timeStamp to timestamp in node and edge specification
1 parent 5b9bd8a commit 576c2ed

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ A vertex instance is a JSON object with name "vertex" and whose value is a JSON
6666

6767
* **id**: An integer id (as a string) automatically generated by GSG that uniquely identifies this vertex in all streams in which it appears, and in the instances file if part of an instance of a tracked pattern.
6868
* **attributes**: A JSON object of name/value pairs, where both the name and value are strings. These are merely copied from the attributes defined for this vertex in the input pattern.
69-
* **timeStamp**: A string representing the time at which this vertex was written to the stream. The format is dictated by the *outputTimeFormat* parameter.
69+
* **timestamp**: A string representing the time at which this vertex was written to the stream. The format is dictated by the *outputTimeFormat* parameter.
7070

7171
### Edge Instance
7272

@@ -78,7 +78,7 @@ object with the following properties.
7878
* **target**: Vertex identifier string for the edge's target vertex instance.
7979
* **directed**: Whether the edge is directed from source to target ("true"), or undirected ("false"). Same as defined in the input pattern.
8080
* **attributes**: A JSON object of name/value pairs, where both the name and value are strings. These are merely copied from the attributes defined for this edge in the input pattern.
81-
* **timeStamp**: A string representing the time at which this edge was written
81+
* **timestamp**: A string representing the time at which this edge was written
8282
to the stream. The format is dictated by the *outputTimeFormat* parameter.
8383

8484
## Output Instances File

gExportGraphML.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def generateGraphML(inputFileName):
1515
'http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">\n')
1616

1717
target.write('<key id="label" for="node" attr.name="label" attr.type="string"/>\n')
18-
target.write('<key id="timeStamp" for="node" attr.name="timeStamp" attr.type="string"/>\n')
18+
target.write('<key id="timestamp" for="node" attr.name="timestamp" attr.type="string"/>\n')
1919

2020
target.write('<key id="label" for="edge" attr.name="label" attr.type="string"/>\n')
21-
target.write('<key id="timeStamp" for="edge" attr.name="timeStamp" attr.type="string"/>\n')
21+
target.write('<key id="timestamp" for="edge" attr.name="timestamp" attr.type="string"/>\n')
2222
target.write('<key id="directed" for="edge" attr.name="directed" attr.type="string"/>\n')
2323

2424
target.write('<graph id="GSG_V1" edgedefault="directed">\n')
@@ -41,12 +41,12 @@ def generateGraphML(inputFileName):
4141
target.write(twoIndent +'<data key='+ key.strip() + '>' + val.strip() + '</data>\n')
4242

4343
# Get Timestamp
44-
timestampLine = next(infile) # "timeStamp": "5"}},\n
45-
vTimestamp = timestampLine.split('"timeStamp": ')[1][:-4]
46-
# Very last timeStamp entry does not end with "," which make the subscript invalid
44+
timestampLine = next(infile) # "timestamp": "5"}},\n
45+
vTimestamp = timestampLine.split('"timestamp": ')[1][:-4]
46+
# Very last timestamp entry does not end with "," which make the subscript invalid
4747
if vTimestamp.endswith('"') == False:
4848
vTimestamp = vTimestamp + '"'
49-
target.write(twoIndent +'<data key="timeStamp">' + vTimestamp + '</data>\n')
49+
target.write(twoIndent +'<data key="timestamp">' + vTimestamp + '</data>\n')
5050
target.write(oneIndent +'</node>\n')
5151

5252
elif line.startswith(' {"edge": {'):
@@ -79,13 +79,13 @@ def generateGraphML(inputFileName):
7979
target.write(twoIndent +'<data key="directed">' + eDir + '</data>\n')
8080

8181
# Get Timestamp
82-
timestampLine = next(infile) # "timeStamp": "5"}},\n
83-
eTimestamp = timestampLine.split('"timeStamp": ')[1][:-4]
82+
timestampLine = next(infile) # "timestamp": "5"}},\n
83+
eTimestamp = timestampLine.split('"timestamp": ')[1][:-4]
8484

85-
# Very last timeStamp entry does not end with "," which make the subscript invalid
85+
# Very last timestamp entry does not end with "," which make the subscript invalid
8686
if eTimestamp.endswith('"') == False:
8787
eTimestamp = eTimestamp + '"'
88-
target.write(twoIndent +'<data key="timeStamp">' + eTimestamp + '</data>\n')
88+
target.write(twoIndent +'<data key="timestamp">' + eTimestamp + '</data>\n')
8989

9090
# End of Edge
9191
target.write(oneIndent + '</edge>\n')
@@ -117,4 +117,4 @@ def main():
117117

118118

119119
if __name__ == '__main__':
120-
main()
120+
main()

gsg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def WriteVertexInstanceToStream(vertexInstance, streamNum):
336336
streamFile.write(' {"vertex": {\n')
337337
streamFile.write(' "id": "' + str(vertexInstance.id) + '",\n')
338338
streamFile.write(' "attributes": ' + DictToJSONString(vertexInstance.attributes) + ',\n')
339-
streamFile.write(' "timeStamp": "' + TimeStr(vertexInstance.streamCreationTimes[streamNum]) + '"}}')
339+
streamFile.write(' "timestamp": "' + TimeStr(vertexInstance.streamCreationTimes[streamNum]) + '"}}')
340340

341341
def WriteEdgeInstanceToStream(edgeInstance, streamNum):
342342
global gStreamFiles
@@ -352,7 +352,7 @@ def WriteEdgeInstanceToStream(edgeInstance, streamNum):
352352
streamFile.write(' "directed": "true",\n')
353353
else:
354354
streamFile.write(' "directed": "false",\n')
355-
streamFile.write(' "timeStamp": "' + TimeStr(edgeInstance.creationTime) + '"}}')
355+
streamFile.write(' "timestamp": "' + TimeStr(edgeInstance.creationTime) + '"}}')
356356

357357
# Convert timeUnit to string according to output time format
358358
def TimeStr(timeUnit):
@@ -384,4 +384,4 @@ def main():
384384
CloseFiles()
385385

386386
if __name__ == "__main__":
387-
main()
387+
main()

0 commit comments

Comments
 (0)