Skip to content

Commit

Permalink
fixed pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
terazus committed Mar 6, 2019
1 parent 14e5cbe commit 93d92af
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/merge_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# In order to merge to set of schemas, you first need to get the output of the semantic diff comparators
# You can then pass that result as an input to the merge class.
# In order to merge to set of schemas, you first need to get the output of the semantic
# diff comparators. You can then pass that result as an input to the merge class.


def merge_sets():
Expand Down
30 changes: 30 additions & 0 deletions examples/miflowcyt_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# The Miflowcyt functionality provide access to the flow repository endpoint.
# From there it gathers metadata about flow cytometry experiments as XML.
# It will then transform these XML into a JSON and inject attributes to
# obtain a final JSON-LD that can be validated against a schema

# To proceed, you must first create a variable that hold the path to a mapping file
# and your user API key from the config file
# You also need to import the FlowRepoClient class from the miflowcyt_validate file of the
# the validate module
import os
import json
from validate.miflowcyt_validate import FlowRepoClient

# Get the path to the mapping file
map_file = os.path.join(os.path.dirname(__file__),
"../tests/data/MiFlowCyt/experiment_mapping.json")

base_schema = "experiment_schema.json" # Get the name of the schema

# Load your API KEY from the config.json file
configfile_path = os.path.join(os.path.dirname(__file__), "../tests/test_config.json")
with open(configfile_path) as config_data_file:
config_json = json.load(config_data_file)
config_data_file.close()
apiKey = config_json["flowrepo_userID"]
items = 1 # Initialize the number of instances to gather from the API

client = FlowRepoClient(map_file, apiKey, items) # initialize the class
instances = client.inject_context() # inject the attributes to obtain a JSON-LD
print(json.dumps(instances, indent=4)) # Enjoy
4 changes: 2 additions & 2 deletions examples/semDiff_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


# First case scenario, your networks are not resolved
# You will need to provide a dictionary of regex term/switch that will help translate the schemas IDs
# into contexts IDs
# You will need to provide a dictionary of regex term/switch that will help
# translate the schemas IDs into contexts IDs
def compare_unresolved_network():

# import the corresponding class
Expand Down

0 comments on commit 93d92af

Please sign in to comment.