I am using the evaluation version at the moment and it compares very well with the features I need from XmlSpy.
I have a rather large Schema file (XSD) and from time to time I like to extract small, self contained, single file, xsd portions from it. Just like XMLSpy (Schema Subset ...).
You have an option to flatten Schema's but I cannot see an option to extract a subset.
Is there such an option?
Many thanks,
Toy
Related
We’ve got a database where there are quite a lot of embedded types. Often the same embedded type occurs multiple times in the same table. The respective columns follow a naming pattern, so it’s easy to identify the different occurrences using an SQL query for example.
What’s the best way to configure jOOQ so that these embedded types gets mapped by the code generator? Note that our real db contains hundreds of tables, so manually configuring this is a no-go.
Fictional example:
create table t(amount int, unit varchar2(4), amount_pend int, unit_pend varchar(4));
Re-using the same embeddable multiple times per table
As of jOOQ 3.15, it is not yet possible to reference the same embeddable type more than once per table. You can only reference it from several tables, once each.
This should obviously be fixed. It seems to be merely a code generation limitation. I've created a feature request for this:
https://github.com/jOOQ/jOOQ/issues/12608
Starting from jOOQ 3.17, you can declare:
<embeddables>
<embeddable>
<name>MONETARY_AMOUNT</name>
<referencingName>AMOUNT_WITH_UNIT</referencingName>
<tables>T/tables>
<fields>
<field><expression>AMOUNT</expression></field>
<field><expression>UNIT</expression></field>
</fields>
</embeddable>
<embeddable>
<name>MONETARY_AMOUNT</name>
<referencingName>AMOUNT_WITH_UNIT_PEND</referencingName>
<tables>T/tables>
<fields>
<field><name>AMOUNT</name><expression>AMOUNT_PEND</expression></field>
<field><name>UNIT</name><expression>UNIT_PEND</expression></field>
</fields>
</embeddable>
</embeddables>
For the time being, you'll have to produce 2 distinct embeddable types, which aren't compatible by name or type, only by structure.
Generating code generation configuration dynamically
The code generation configuration is a JAXB-annotated API, which happens to conveniently map to:
Maven: https://www.jooq.org/doc/latest/manual/code-generation/codegen-maven/
Standalone XML files following this XSD (or a newer version): https://www.jooq.org/xsd/jooq-codegen-3.16.0.xsd
But you can also use the code generation API programmatically yourself and thus generate the configuration elements dynamically:
https://www.jooq.org/doc/latest/manual/code-generation/codegen-programmatic/
Or, since it's all XML based, you could use XSLT to generate the configuration
Hello everyone,
because of my lack of experience with ontologies and web semantics, I have a conceptual misunderstanding. When we refer to 'ontology population', do we make clones of the ontology with our concrete data or do we map our concrete data to the ontology? If so, how is it done? My intention is to build a knowledge graph using an ontology (FIBO ontology for the loans domain) and I have also an excel file with loans data. Not every entry in my excel file corresponds to the ontology classes predefined. However, that is not a major problem I suppose. So, to make myself more clear, I want to know how do I practically populate the ontology?
Also, I would like to note that I am using neo4j as a graph database and python as my implementation language, so the process of the population of the ontology would have been done using its libraries.
Thanks in advance for your time!
This video could inform your understanding about modelling and imports for graph database design: https://www.youtube.com/watch?v=oXziS-PPIUA
He steps through importing a CSV in to Neo4j and uses python.
The terms ontology and web semantics (OWL) are probably not what you're asking about (being loans/finance domain, rather than web). Further web semantics is not taken very seriously by professionals these days.
"Graph database modelling" is probably a useful area of research to solve your problem.
I can recommend you use Apache Jena to populate your ontology with the data source. You can use either Java or Python. The first step begins with extracting triples from the loaded data depending on the RDF schema, which is the basis of triple extraction. The used parser in this step may differ to be compatible with the data source in your case it is the excel file. After extracting triples, an intermediate data model (IDM) is used for mapping from the triple format. IDM could be in any useful format for mapping, like JSON. After mapping, the next step will be loading the individuals from the intermediate data model to the RDF schema that was previously used. Now the RDF schema is updated to contain the individuals too. At this phase, you should review the updated schema to check whether it needs more data, then run the logic reasoner to evaluate and correct the possible problems and inconsistencies. If the Reasoner runs without any error, the RDF schema now contains all the possible individuals and you could use it for visualisation using Neo4j
I'm attempting to make a comparison of two Oracle DBs - I'm running a report on two different schema names - in my case, a schema prefix. E.g. Using:
-schemas=FOO.*
then
-schemas=BAR.*
Is there a way of hiding this prefix from the report, so that it isn't shown as an obvious difference when comparing the two reports?
I know I can use the 'unimportant' text feature in Beyond Compare, but it would be nice to cover this upfront.
I have a feeling that I'm missing something obvious, or maybe no one ever requires this as the schema name is fairly fundamental. I suppose I am just comparing across schemas.
If it is in the help, I have probably misunderstood what I have read.
Any hints would be welcome.
Many thanks.
Of course, this was answered in an obvious place...
SchemaCrawler HowTo
How to hide catalog and schema names in text output
Change the configuration for the SchemaCrawler
schemacrawler.format.show_unqualified_names=true in the
schemacrawler.config.properties file. This setting will show
unqualified names of database objects such as tables and prcodures.
That is, the catalog and schema names will not be displayed. Use with
care, especially if you have foreign keys that reference tables in
other schemas, or synonyms.
However, in my situation, the output was actually within returned SQL and procedures etc, so is fundamental to what the DB is holding.
As far as I can see, my best way is to use Beyond Compare or something similar to strip these small strings out to aid in the comparison.
I've checked the ISO 639-1 specs but can't find any references. I can just make something up for my database, but was curious if there is a standard.
Update 2012-02-26: I ended up creating a special entry in my languages table with an asterisk (*) as the country code which I now use to represent entries in no single language.
ISO 639-2 and ISO 639-3 reserved the code mul for documents that contain multiple languages.
By the way, IETF BCP 47 is currently the most authoritative document on the use of language codes.
There is some precedence for using commas when storing multiple ISO language codes, but for a database entry, another table might be prudent when storing such metadata (or even the data itself along with it's language code, if it can be partitioned at the paragraph or even sentence level) to represent such a one to many relationship.
If you are referring to collation, and you are dealing with multiple languages, then it would be best to convert the text to a Unicode charset that your database supports, and store multilingual text in that format.
I'm trying to create an XML schema to describe some aspects of hospitals. A hospital may have 24 hour coverage on: emergency services, operating room, pharmacist, etc. The entire list is relatively short - around 10. The coverage may be on more than one of these services.
My question is how best to represent this. I'm thinking along the lines of:
<coverage>
<emergencyServices/>
<operatingRoom/>
</coverage>
Basically, the services are optional and, if they exist, the coverage is offered by the hospital.
Alternatively, I could have:
<coverage>
<emergencyServices>true</emergencyServices>
<operatingRoom>true</operatingRoom>
<pharmacist>false</pharmacist>
</coverage>
In this case, I require all the elements, but a value of false means that the coverage isn't offered.
There are probably other approaches.
What's the best practice for something like this? And, if I use the first option, what type should the elements be in the schema?
Best practice here depends really on the consumer.
The short and simple rule is that markup is for structure, and content is for data. So having them contain xs:boolean values is generally the best course.
Now, on to the options:
Having separate untyped elements is simple and clear; sometimes processing systems may have difficulty reading them, because some XML-relational mappers may not see any data in the elements to put in relational tables. But if they had values, like <emergencyServices>true</emergencyServices>, then the relational table would have a value to hold.
Again, if you have fixed element names, it means if your consumer is using a system that maps the XML to a database, every time you add a service, a schema change will have to be made.
There are several other ways; each has trade-offs:
Using a <xs:string> with an enumeration, and allow multiple copies. Then you could have <coverage>emergencyServices</coverage><coverage>operatingRoom</coverage>. It makes adding to the list simpler, but allows duplicates. This scheme does not require schema changes in the database for the consumer.
You could use attributes on the <coverage> element. They would have a xs:boolean type, but still require a schema change. Of course, this evokes the attribute vs. element argument.
One good resource is Chapter 11 of Effective XML. At least this should be read before making a final decision.